NCBI C++ ToolKit
Macros | Functions | Variables
ncbi_usage_report.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbistr.hpp>
#include <corelib/ncbi_param.hpp>
#include <connect/ncbi_usage_report.hpp>
#include <sstream>
#include <atomic>
+ Include dependency graph for ncbi_usage_report.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Macros

#define MT_GUARD   std::lock_guard<std::mutex> mt_usage_guard(m_Usage_Mutex)
 Helpers. More...
 

Functions

 NCBI_PARAM_DECL (string, USAGE_REPORT, URL)
 
 NCBI_PARAM_DEF_EX (string, USAGE_REPORT, URL, kDefault_URL, eParam_NoThread, NCBI_USAGE_REPORT_URL)
 
 NCBI_PARAM_DECL (bool, USAGE_REPORT, Enabled)
 
 NCBI_PARAM_DEF_EX (bool, USAGE_REPORT, Enabled, kDefault_IsEnabled, eParam_NoThread, NCBI_USAGE_REPORT_ENABLED)
 
 NCBI_PARAM_DECL (string, USAGE_REPORT, AppName)
 
 NCBI_PARAM_DEF_EX (string, USAGE_REPORT, AppName, "", eParam_NoThread, NCBI_USAGE_REPORT_APPNAME)
 
 NCBI_PARAM_DECL (string, USAGE_REPORT, AppVersion)
 
 NCBI_PARAM_DEF_EX (string, USAGE_REPORT, AppVersion, "", eParam_NoThread, NCBI_USAGE_REPORT_APPVERSION)
 
 NCBI_PARAM_DECL (unsigned, USAGE_REPORT, MaxQueueSize)
 
 NCBI_PARAM_DEF_EX (unsigned, USAGE_REPORT, MaxQueueSize, kDefault_MaxQueueSize, eParam_NoThread, NCBI_USAGE_REPORT_MAXQUEUESIZE)
 
 NCBI_PARAM_DECL (double, USAGE_REPORT, ConnTimeout)
 
 NCBI_PARAM_DEF_EX (double, USAGE_REPORT, ConnTimeout, kDefault_ConnTimeout, eParam_NoThread, NCBI_USAGE_REPORT_CONN_TIMEOUT)
 
 NCBI_PARAM_DECL (int, USAGE_REPORT, ConnMaxTry)
 
 NCBI_PARAM_DEF_EX (int, USAGE_REPORT, ConnMaxTry, kDefault_ConnMaxTry, eParam_NoThread, NCBI_USAGE_REPORT_CONN_MAX_TRY)
 
 NCBI_PARAM_DECL (double, USAGE_REPORT, WaitTimeout)
 
 NCBI_PARAM_DEF_EX (double, USAGE_REPORT, WaitTimeout, kDefault_WaitTimeout, eParam_NoThread, NCBI_USAGE_REPORT_WAIT_TIMEOUT)
 
static atomic< CUsageReport::TWhatgs_DefaultParams (CUsageReport::fDefault)
 CUsageReportAPI:: More...
 
bool s_CheckConnection (const string &url)
 
void s_AddDefaultParam (CUsageReportParameters &params, const string &name, const string &value)
 

Variables

const char * kDefault_URL = "https://www.ncbi.nlm.nih.gov/stat"
 
const bool kDefault_IsEnabled = false
 
const unsigned kDefault_MaxQueueSize = 100
 
const double kDefault_ConnTimeout = -1
 
const int kDefault_ConnMaxTry = -1
 
const double kDefault_WaitTimeout = -1
 
static bool gs_IsEnabled = NCBI_PARAM_TYPE(USAGE_REPORT, Enabled)::GetDefault()
 

Macro Definition Documentation

◆ MT_GUARD

#define MT_GUARD   std::lock_guard<std::mutex> mt_usage_guard(m_Usage_Mutex)

Helpers.

CUsageReport::

Definition at line 414 of file ncbi_usage_report.cpp.

Function Documentation

◆ gs_DefaultParams()

static atomic<CUsageReport::TWhat> gs_DefaultParams ( CUsageReport::fDefault  )
static

◆ NCBI_PARAM_DECL() [1/8]

NCBI_PARAM_DECL ( bool  ,
USAGE_REPORT  ,
Enabled   
)

◆ NCBI_PARAM_DECL() [2/8]

NCBI_PARAM_DECL ( double  ,
USAGE_REPORT  ,
ConnTimeout   
)

◆ NCBI_PARAM_DECL() [3/8]

NCBI_PARAM_DECL ( double  ,
USAGE_REPORT  ,
WaitTimeout   
)

◆ NCBI_PARAM_DECL() [4/8]

NCBI_PARAM_DECL ( int  ,
USAGE_REPORT  ,
ConnMaxTry   
)

◆ NCBI_PARAM_DECL() [5/8]

NCBI_PARAM_DECL ( string  ,
USAGE_REPORT  ,
AppName   
)

◆ NCBI_PARAM_DECL() [6/8]

NCBI_PARAM_DECL ( string  ,
USAGE_REPORT  ,
AppVersion   
)

◆ NCBI_PARAM_DECL() [7/8]

NCBI_PARAM_DECL ( string  ,
USAGE_REPORT  ,
URL   
)

◆ NCBI_PARAM_DECL() [8/8]

NCBI_PARAM_DECL ( unsigned  ,
USAGE_REPORT  ,
MaxQueueSize   
)

◆ NCBI_PARAM_DEF_EX() [1/8]

NCBI_PARAM_DEF_EX ( bool  ,
USAGE_REPORT  ,
Enabled  ,
kDefault_IsEnabled  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_ENABLED   
)

◆ NCBI_PARAM_DEF_EX() [2/8]

NCBI_PARAM_DEF_EX ( double  ,
USAGE_REPORT  ,
ConnTimeout  ,
kDefault_ConnTimeout  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_CONN_TIMEOUT   
)

◆ NCBI_PARAM_DEF_EX() [3/8]

NCBI_PARAM_DEF_EX ( double  ,
USAGE_REPORT  ,
WaitTimeout  ,
kDefault_WaitTimeout  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_WAIT_TIMEOUT   
)

◆ NCBI_PARAM_DEF_EX() [4/8]

NCBI_PARAM_DEF_EX ( int  ,
USAGE_REPORT  ,
ConnMaxTry  ,
kDefault_ConnMaxTry  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_CONN_MAX_TRY   
)

◆ NCBI_PARAM_DEF_EX() [5/8]

NCBI_PARAM_DEF_EX ( string  ,
USAGE_REPORT  ,
AppName  ,
""  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_APPNAME   
)

◆ NCBI_PARAM_DEF_EX() [6/8]

NCBI_PARAM_DEF_EX ( string  ,
USAGE_REPORT  ,
AppVersion  ,
""  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_APPVERSION   
)

◆ NCBI_PARAM_DEF_EX() [7/8]

NCBI_PARAM_DEF_EX ( string  ,
USAGE_REPORT  ,
URL  ,
kDefault_URL  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_URL   
)

◆ NCBI_PARAM_DEF_EX() [8/8]

NCBI_PARAM_DEF_EX ( unsigned  ,
USAGE_REPORT  ,
MaxQueueSize  ,
kDefault_MaxQueueSize  ,
eParam_NoThread  ,
NCBI_USAGE_REPORT_MAXQUEUESIZE   
)

◆ s_AddDefaultParam()

void s_AddDefaultParam ( CUsageReportParameters params,
const string name,
const string value 
)
inline

Definition at line 424 of file ncbi_usage_report.cpp.

References CUsageReportParameters::Add(), and rapidjson::value.

Referenced by CUsageReport::CUsageReport().

◆ s_CheckConnection()

bool s_CheckConnection ( const string url)

Variable Documentation

◆ gs_IsEnabled

bool gs_IsEnabled = NCBI_PARAM_TYPE(USAGE_REPORT, Enabled)::GetDefault()
static

◆ kDefault_ConnMaxTry

const int kDefault_ConnMaxTry = -1

Definition at line 61 of file ncbi_usage_report.cpp.

◆ kDefault_ConnTimeout

const double kDefault_ConnTimeout = -1

Definition at line 58 of file ncbi_usage_report.cpp.

Referenced by CUsageReportAPI::SetTimeout().

◆ kDefault_IsEnabled

const bool kDefault_IsEnabled = false

Definition at line 52 of file ncbi_usage_report.cpp.

◆ kDefault_MaxQueueSize

const unsigned kDefault_MaxQueueSize = 100

Definition at line 55 of file ncbi_usage_report.cpp.

Referenced by CUsageReportAPI::SetMaxQueueSize().

◆ kDefault_URL

const char* kDefault_URL = "https://www.ncbi.nlm.nih.gov/stat"

Definition at line 49 of file ncbi_usage_report.cpp.

◆ kDefault_WaitTimeout

const double kDefault_WaitTimeout = -1

Definition at line 64 of file ncbi_usage_report.cpp.

Modified on Tue May 21 11:01:35 2024 by modify_doxy.py rev. 669887