NCBI C++ ToolKit
|
Classes | |
struct | SHEAP_Block |
struct | SHINFO_Params |
Host parameters. More... | |
struct | SHINFO_PortUsage |
Port usage. More... | |
struct | SSERV_NcbidInfo |
struct | SSERV_StandaloneInfo |
struct | SSERV_HttpInfo |
struct | SSERV_FirewallInfo |
struct | SSERV_DnsInfo |
union | USERV_Info |
struct | SSERV_Info |
class | CUsageReportBase |
CUsageReportBase:: Base class to define common types for CUsageReport API. More... | |
class | CUsageReportAPI |
CUsageReportAPI:: Global settings related to the usage reporting. More... | |
class | CUsageReportParameters |
CUsageReportParameters:: More... | |
class | CUsageReportJob |
CUsageReportJob:: More... | |
class | CUsageReport |
CUsageReport:: More... | |
Macros | |
#define | SERV_DEFAULT_ALGO eSERV_Regular |
#define | SERV_MINIMAL_RATE 0.001 |
#define | SERV_MAXIMAL_RATE 100000.0 |
#define | SERV_MINIMAL_BONUS 0.01 |
#define | SERV_MAXIMAL_BONUS 100.0 |
#define | SERV_NCBID_ARGS(ui) ((char*)(ui) + (ui)->args) |
#define | SERV_HTTP_PATH(ui) ((char*)(ui) + (ui)->path) |
#define | SERV_HTTP_ARGS(ui) ((char*)(ui) + (ui)->args) |
#define | SERV_CLIENT_REVISION_MAJOR 7 |
Revision 7.0. More... | |
#define | SERV_CLIENT_REVISION_MINOR 0 |
#define | SERV_LOCALHOST ((unsigned int)(~0UL)) |
Special values for the "preferred_host" parameter. More... | |
#define | SERV_ANYHOST 0 |
#define | NCBI_REPORT_USAGE(event, ...) __NCBI_REPORT_USAGE(event, __VA_ARGS__) |
Convenience macro to log "jsevent" usage statistics (asynchronously). More... | |
#define | __NCBI_REPORT_USAGE(event, args) |
#define | NCBI_REPORT_USAGE_START CUsageReportAPI::SetEnabled() |
Enable usage statistics reporting (globally for all reporters). More... | |
#define | NCBI_REPORT_USAGE_WAIT CUsageReport::Instance().Wait(CUsageReport::eAlways) |
Wait until all reports via NCBI_REPORT_USAGE will be processed. More... | |
#define | NCBI_REPORT_USAGE_WAIT_ALWAYS CUsageReport::Instance().Wait(CUsageReport::eAlways) |
#define | NCBI_REPORT_USAGE_WAIT_TIMEOUT(t) CUsageReport::Instance().Wait(CUsageReport::eAlways, t) |
#define | NCBI_REPORT_USAGE_WAIT_IF_SUCCESS CUsageReport::Instance().Wait(CUsageReport::eSkipIfNoConnection) |
#define | NCBI_REPORT_USAGE_FINISH CUsageReport::Instance().Finish() |
Finishing reporting via NCBI_REPORT_USAGE and global usage reporter,. More... | |
Typedefs | |
typedef struct SHEAP_tag * | HEAP |
typedef void *(* | FHEAP_Resize) (void *old_base, TNCBI_Size new_size, void *auxarg) |
typedef struct SHostInfoTag * | HOST_INFO |
Handle for the user code use. More... | |
typedef unsigned short | TNcbiArch |
typedef unsigned short | TNcbiCapacity |
typedef unsigned short | TNcbiOSType |
typedef unsigned char | TSERV_Algo |
typedef unsigned char | TSERV_Mode |
typedef unsigned char | TSERV_Site |
typedef struct SSERV_IterTag * | SERV_ITER |
Iterator through the servers. More... | |
typedef const SSERV_Info * | SSERV_InfoCPtr |
Simplified (uncluttered) SSERV_Info pointer type. More... | |
typedef unsigned int | TSERV_Type |
Bitwise OR of ESERV_Type[Special]. More... | |
typedef unsigned short | TSERV_TypeOnly |
Server type only, w/o specials. More... | |
typedef int | CUsageReportBase::TWhat |
Binary OR of "EWhat". More... | |
using | CUsageReport::TJobPtr = CUsageReportJob * |
Functions | |
HEAP | HEAP_Create (void *base, TNCBI_Size size, TNCBI_Size chunk_size, FHEAP_Resize resize, void *auxarg) |
HEAP | HEAP_Attach (const void *base, TNCBI_Size maxsize, int serial) |
HEAP | HEAP_AttachFast (const void *base, TNCBI_Size size, int serial) |
SHEAP_Block * | HEAP_Alloc (HEAP heap, TNCBI_Size size, int hint) |
void | HEAP_Free (HEAP heap, SHEAP_Block *ptr) |
void | HEAP_FreeFast (HEAP heap, SHEAP_Block *ptr, const SHEAP_Block *prev) |
SHEAP_Block * | HEAP_Walk (const HEAP heap, const SHEAP_Block *prev) |
SHEAP_Block * | HEAP_Next (const HEAP heap, const SHEAP_Block *prev) |
HEAP | HEAP_Trim (HEAP heap) |
HEAP | HEAP_Copy (const HEAP orig, size_t extra, int serial) |
unsigned int | HEAP_AddRef (HEAP heap) |
unsigned int | HEAP_Detach (HEAP heap) |
unsigned int | HEAP_Destroy (HEAP heap) |
void * | HEAP_Base (const HEAP heap) |
TNCBI_Size | HEAP_Size (const HEAP heap) |
TNCBI_Size | HEAP_Used (const HEAP heap) |
TNCBI_Size | HEAP_Idle (const HEAP heap) |
int | HEAP_Serial (const HEAP heap) |
void | HEAP_Options (ESwitch fast, ESwitch unused) |
unsigned int | HINFO_HostAddr (const HOST_INFO host_info) |
Get the official host address. More... | |
int | HINFO_CpuCount (const HOST_INFO host_info) |
Get CPU count (number of logical cores, hyper-threaded included). More... | |
int | HINFO_CpuUnits (const HOST_INFO host_info) |
Get physical CPU count (number of physical cores, not packages). More... | |
double | HINFO_CpuClock (const HOST_INFO host_info) |
Get CPU clock rate. More... | |
int | HINFO_TaskCount (const HOST_INFO host_info) |
Get task count. More... | |
int | HINFO_Memusage (const HOST_INFO host_info, double memusage[5]) |
Get memory usage data. More... | |
int | HINFO_MachineParams (const HOST_INFO host_info, SHINFO_Params *params) |
Get host parameters. More... | |
int | HINFO_PortUsage (const HOST_INFO host_info, SHINFO_PortUsage ports[], size_t count) |
Obtain host port usage (currently only 4 first ports are published). More... | |
int | HINFO_LoadAverage (const HOST_INFO host_info, double lavg[2]) |
Obtain host load averages. More... | |
int | HINFO_Status (const HOST_INFO host_info, double status[2]) |
Obtain LB host availability status. More... | |
const char * | HINFO_Environment (const HOST_INFO host_info) |
Obtain and return LB host environment. More... | |
const char * | HINFO_AffinityArgument (const HOST_INFO host_info) |
Obtain the affinity argument that has keyed the service selection (if argument affinities have been used at all). More... | |
const char * | HINFO_AffinityArgvalue (const HOST_INFO host_info) |
Obtain the affinity argument's value that has keyed the service selection (if argument affinities have been used at all). More... | |
const char * | SERV_TypeStr (ESERV_Type type) |
const char * | SERV_ReadType (const char *str, ESERV_Type *type) |
SSERV_Info * | SERV_CreateNcbidInfo (unsigned int host, unsigned short port, const char *args) |
SSERV_Info * | SERV_CreateStandaloneInfo (unsigned int host, unsigned short port) |
SSERV_Info * | SERV_CreateHttpInfo (ESERV_Type type, unsigned int host, unsigned short port, const char *path, const char *args) |
SSERV_Info * | SERV_CreateFirewallInfo (unsigned int host, unsigned short port, ESERV_Type type) |
SSERV_Info * | SERV_CreateDnsInfo (unsigned int host) |
char * | SERV_WriteInfo (const SSERV_Info *info) |
SSERV_Info * | SERV_ReadInfo (const char *info_str) |
SSERV_Info * | SERV_CopyInfo (const SSERV_Info *info) |
size_t | SERV_SizeOfInfo (const SSERV_Info *info) |
int | SERV_EqualInfo (const SSERV_Info *info1, const SSERV_Info *info2) |
SERV_ITER | SERV_OpenEx (const char *service, TSERV_Type types, unsigned int preferred_host, const SConnNetInfo *net_info, SSERV_InfoCPtr skip[], size_t n_skip) |
Create an iterator for sequential server lookup. More... | |
SERV_ITER | SERV_Open (const char *service, TSERV_Type types, unsigned int preferred_host, const SConnNetInfo *net_info) |
Same as "SERV_OpenEx(., ., ., ., 0, 0)" – i.e. More... | |
SERV_ITER | SERV_OpenSimple (const char *service) |
Allocate an iterator and consult either local databases (if any present), or network database, using all default communication parameters found both in the registry and the environment variables (as if having an implicit parameter "net_info" created with "ConnNetInfo_Create(service)"). More... | |
SSERV_InfoCPtr | SERV_GetNextInfoEx (SERV_ITER iter, HOST_INFO *host_info) |
Get the next server meta-address, optionally accompanied by the host parameters made available by the LB daemon (LBSMD). More... | |
SSERV_InfoCPtr | SERV_GetNextInfo (SERV_ITER iter) |
Same as "SERV_GetNextInfoEx(., 0)" – i.e. More... | |
SSERV_Info * | SERV_GetInfoEx (const char *service, TSERV_Type types, unsigned int preferred_host, const SConnNetInfo *net_info, SSERV_InfoCPtr skip[], size_t n_skip, HOST_INFO *host_info) |
A "fast track" routine equivalent to creating of an iterator as with SERV_OpenEx(), and then taking an info as with SERV_GetNextInfoEx(). More... | |
SSERV_Info * | SERV_GetInfo (const char *service, TSERV_Type types, unsigned int preferred_host, const SConnNetInfo *net_info) |
Same as "SERV_GetInfoEx(., ., ., ., 0, 0, 0)" – i.e. More... | |
SSERV_Info * | SERV_GetInfoSimple (const char *service) |
Equivalent to "SERV_GetInfo(., fSERV_Any, SERV_ANYHOST,
ConnNetInfo_Create(service))", but it takes care not to leak its last "net_info" parameter, which it builds on the fly. More... | |
int | SERV_Penalize (SERV_ITER iter, double fine) |
Penalize the server returned last from SERV_GetNextInfo[Ex](). More... | |
int | SERV_Rerate (SERV_ITER iter, double rate) |
Rerate the server returned last from SERV_GetNextInfo[Ex](). More... | |
void | SERV_Reset (SERV_ITER iter) |
Reset the iterator to the state as if it has just been opened. More... | |
void | SERV_Close (SERV_ITER iter) |
Deallocate the iterator. More... | |
unsigned short | SERV_ServerPort (const char *name, unsigned int host) |
Obtain a port number that corresponds to the named (standalone) service declared at the specified host (per the LB configuration information). More... | |
int | SERV_SetImplicitServerType (const char *service, ESERV_Type type) |
Set a server type to use when a service mapper returns typeless entries for the given service name (typed entries retain their types as received). More... | |
ESERV_Type | SERV_GetImplicitServerType (const char *service) |
Get a server type that would be assigned to typeless entries for the given service name. More... | |
static void | CUsageReportAPI::SetEnabled (bool enable=true) |
Enable or disable usage statistics reporting globally for all reporters. More... | |
static bool | CUsageReportAPI::IsEnabled (void) |
Indicates whether global application usage statistics collection is enabled. More... | |
static void | CUsageReportAPI::SetDefaultParameters (TWhat what=fDefault) |
Set default reporting parameters. More... | |
static TWhat | CUsageReportAPI::GetDefaultParameters (void) |
static void | CUsageReportAPI::SetURL (const string &url) |
Change CGI URL for reporting usage statistics. More... | |
static string | CUsageReportAPI::GetURL (void) |
static void | CUsageReportAPI::SetAppName (const string &name) |
Set application name for the usage reporters. More... | |
static string | CUsageReportAPI::GetAppName (void) |
static void | CUsageReportAPI::SetAppVersion (const string &version) |
Set application version for the usage reporter(s). More... | |
static void | CUsageReportAPI::SetAppVersion (const CVersionInfo &version) |
static string | CUsageReportAPI::GetAppVersion (void) |
static void | CUsageReportAPI::SetMaxQueueSize (unsigned n) |
Declare the maximum reporting jobs queue size per reporter. More... | |
static unsigned | CUsageReportAPI::GetMaxQueueSize () |
static void | CUsageReportAPI::SetTimeout (const CTimeout &timeout) |
Set timeout for connection. More... | |
static CTimeout | CUsageReportAPI::GetTimeout () |
Return timeout for network connection, if specified. More... | |
static void | CUsageReportAPI::SetRetries (int retries) |
Set muximum number of retries in case of error reporting. More... | |
static int | CUsageReportAPI::GetRetries () |
Return muximum number of retries in case of error reporting, if specified. More... | |
static bool | CUsageReportAPI::CheckConnection () |
Check that connection to reporting URL can be established. More... | |
CUsageReportParameters::CUsageReportParameters (void) | |
CUsageReportParameters & | CUsageReportParameters::Add (const string &name, const string &value) |
Add argument Name must contain only alphanumeric chars or '_'. More... | |
CUsageReportParameters & | CUsageReportParameters::Add (const string &name, const char *value) |
template<typename TValue > | |
CUsageReportParameters & | CUsageReportParameters::Add (const string &name, TValue value) |
string | CUsageReportParameters::ToString () const |
Convert parameters to string. URL-encode all values. More... | |
CUsageReportParameters::CUsageReportParameters (const CUsageReportParameters &other) | |
Copy constructor. More... | |
CUsageReportParameters & | CUsageReportParameters::operator= (const CUsageReportParameters &other) |
Copy assignment operator. More... | |
void | CUsageReportParameters::x_CopyFrom (const CUsageReportParameters &other) |
Copy parameters to another objects. More... | |
CUsageReportJob::CUsageReportJob (void) | |
Default constructor. More... | |
virtual | CUsageReportJob::~CUsageReportJob (void) |
Destructor. More... | |
EState | CUsageReportJob::GetState () |
Return current job state. More... | |
virtual void | CUsageReportJob::OnStateChange (EState) |
Callback for async reporting. More... | |
CUsageReportJob::CUsageReportJob (const CUsageReportJob &other) | |
Copy constructor. More... | |
CUsageReportJob & | CUsageReportJob::operator= (const CUsageReportJob &other) |
Copy assignment operator. More... | |
void | CUsageReportJob::x_SetState (EState state) |
Set new job state. More... | |
void | CUsageReportJob::x_CopyFrom (const CUsageReportJob &other) |
Copy data from 'other' job. More... | |
static CUsageReport & | CUsageReport::Instance (void) |
Return global instance of CUsageReport. More... | |
CUsageReport::CUsageReport (TWhat what=fDefault, const string &url=string(), unsigned max_queue_size=0) | |
Constructor. More... | |
virtual | CUsageReport::~CUsageReport (void) |
Destructor. More... | |
void | CUsageReport::SetEnabled (bool enable=true) |
Enable or disable usage reporter (current instance only). More... | |
bool | CUsageReport::IsEnabled (void) |
Indicates whether application usage statistics collection is enabled for a current reporter instance. More... | |
void | CUsageReport::Send (void) |
Report usage statistics (asynchronously), default parameters. More... | |
void | CUsageReport::Send (CUsageReportParameters ¶ms) |
Report usage statistics (asynchronously). More... | |
template<typename TJob > | |
void | CUsageReport::Send (TJob &job) |
Report usage statistics (asynchronously) (advanced version). More... | |
unsigned | CUsageReport::GetQueueSize (void) |
Get number of jobs in the queue – number of unprocessed yet jobs. More... | |
void | CUsageReport::ClearQueue (void) |
Remove all unprocessed reporting jobs from queue. More... | |
void | CUsageReport::Wait (EWait how=eAlways, CTimeout timeout=CTimeout(CTimeout::eDefault)) |
Wait until all queued jobs starts to process and queue is empty. More... | |
void | CUsageReport::Finish (void) |
Finish reporting for the current reporting object. More... | |
bool | CUsageReport::CheckConnection () |
Check that connection to the reporting URL can be established. More... | |
CUsageReport::CUsageReport (const CUsageReport &)=delete | |
Prevent copying. More... | |
CUsageReport & | CUsageReport::operator= (const CUsageReport &)=delete |
bool | CUsageReport::x_Send (const string &extra_params) |
Send parameters string synchronously. More... | |
void | CUsageReport::x_SendAsync (TJobPtr job_ptr) |
Send job asynchronously. More... | |
void | CUsageReport::x_ThreadHandler (void) |
Thread handler for asynchronous job reporting. More... | |
void | CUsageReport::x_ClearQueue (void) |
Remove all unprocessed reporting jobs from queue - internal version. More... | |
Friends | |
class | CUsageReportParameters::CUsageReport |
class | CUsageReportJob::CUsageReport |
class | CUsageReport::CUsageReportAPI |
#define __NCBI_REPORT_USAGE | ( | event, | |
args | |||
) |
Definition at line 709 of file ncbi_usage_report.hpp.
#define NCBI_REPORT_USAGE | ( | event, | |
... | |||
) | __NCBI_REPORT_USAGE(event, __VA_ARGS__) |
Convenience macro to log "jsevent" usage statistics (asynchronously).
event | Value for "jsevent" parameter. Automatically set "jsevent=...". |
args | A chain of additional parameters to report. Optional. You can list as many .Add() calls here as you want, or drop this parameter at all. See usage example. |
Definition at line 707 of file ncbi_usage_report.hpp.
#define NCBI_REPORT_USAGE_FINISH CUsageReport::Instance().Finish() |
Finishing reporting via NCBI_REPORT_USAGE and global usage reporter,.
Definition at line 733 of file ncbi_usage_report.hpp.
#define NCBI_REPORT_USAGE_START CUsageReportAPI::SetEnabled() |
Enable usage statistics reporting (globally for all reporters).
Definition at line 721 of file ncbi_usage_report.hpp.
#define NCBI_REPORT_USAGE_WAIT CUsageReport::Instance().Wait(CUsageReport::eAlways) |
Wait until all reports via NCBI_REPORT_USAGE will be processed.
Wait() method have more arguments, so please use it directly if more functionality is required.
Definition at line 726 of file ncbi_usage_report.hpp.
#define NCBI_REPORT_USAGE_WAIT_ALWAYS CUsageReport::Instance().Wait(CUsageReport::eAlways) |
Definition at line 727 of file ncbi_usage_report.hpp.
#define NCBI_REPORT_USAGE_WAIT_IF_SUCCESS CUsageReport::Instance().Wait(CUsageReport::eSkipIfNoConnection) |
Definition at line 729 of file ncbi_usage_report.hpp.
#define NCBI_REPORT_USAGE_WAIT_TIMEOUT | ( | t | ) | CUsageReport::Instance().Wait(CUsageReport::eAlways, t) |
Definition at line 728 of file ncbi_usage_report.hpp.
#define SERV_ANYHOST 0 |
Definition at line 55 of file ncbi_service.h.
#define SERV_CLIENT_REVISION_MAJOR 7 |
Revision 7.0.
Definition at line 47 of file ncbi_service.h.
#define SERV_CLIENT_REVISION_MINOR 0 |
Definition at line 48 of file ncbi_service.h.
#define SERV_DEFAULT_ALGO eSERV_Regular |
Definition at line 54 of file ncbi_server_info.h.
#define SERV_HTTP_ARGS | ( | ui | ) | ((char*)(ui) + (ui)->args) |
Definition at line 138 of file ncbi_server_info.h.
#define SERV_HTTP_PATH | ( | ui | ) | ((char*)(ui) + (ui)->path) |
Definition at line 137 of file ncbi_server_info.h.
#define SERV_LOCALHOST ((unsigned int)(~0UL)) |
Special values for the "preferred_host" parameter.
Definition at line 54 of file ncbi_service.h.
#define SERV_MAXIMAL_BONUS 100.0 |
Definition at line 58 of file ncbi_server_info.h.
#define SERV_MAXIMAL_RATE 100000.0 |
Definition at line 56 of file ncbi_server_info.h.
#define SERV_MINIMAL_BONUS 0.01 |
Definition at line 57 of file ncbi_server_info.h.
#define SERV_MINIMAL_RATE 0.001 |
Definition at line 55 of file ncbi_server_info.h.
#define SERV_NCBID_ARGS | ( | ui | ) | ((char*)(ui) + (ui)->args) |
Definition at line 127 of file ncbi_server_info.h.
typedef void*(* FHEAP_Resize) (void *old_base, TNCBI_Size new_size, void *auxarg) |
Definition at line 80 of file ncbi_heapmgr.h.
Definition at line 53 of file ncbi_heapmgr.h.
typedef struct SHostInfoTag* HOST_INFO |
Handle for the user code use.
Definition at line 60 of file ncbi_host_info.h.
typedef struct SSERV_IterTag* SERV_ITER |
Iterator through the servers.
Definition at line 66 of file ncbi_service.h.
typedef const SSERV_Info* SSERV_InfoCPtr |
Simplified (uncluttered) SSERV_Info pointer type.
Definition at line 70 of file ncbi_service.h.
|
private |
Definition at line 652 of file ncbi_usage_report.hpp.
typedef unsigned short TNcbiArch |
Definition at line 151 of file ncbi_host_info.h.
typedef unsigned short TNcbiCapacity |
Definition at line 160 of file ncbi_host_info.h.
typedef unsigned short TNcbiOSType |
Definition at line 174 of file ncbi_host_info.h.
typedef unsigned char TSERV_Algo |
Definition at line 87 of file ncbi_server_info.h.
typedef unsigned char TSERV_Mode |
Definition at line 94 of file ncbi_server_info.h.
typedef unsigned char TSERV_Site |
Definition at line 103 of file ncbi_server_info.h.
typedef unsigned int TSERV_Type |
Bitwise OR of ESERV_Type[Special].
Definition at line 94 of file ncbi_service.h.
typedef unsigned short TSERV_TypeOnly |
Server type only, w/o specials.
Definition at line 95 of file ncbi_service.h.
typedef int CUsageReportBase::TWhat |
Binary OR of "EWhat".
Definition at line 96 of file ncbi_usage_report.hpp.
enum ENcbiArch |
Enumerator | |
---|---|
fArch_Virtual | Set when a VM. |
fArch_Unknown | Unknown/undefined CPU type. |
Definition at line 146 of file ncbi_host_info.h.
enum ENcbiCapacity |
Enumerator | |
---|---|
fCapacity_Unknown | |
fCapacity_32 | 32 bits only |
fCapacity_64 | 64 bits, but 32-bit backward compatible |
fCapacity_32_64 | 32 bits, but 64-bit forward compatible |
Definition at line 154 of file ncbi_host_info.h.
enum ENcbiOSType |
Enumerator | |
---|---|
fOS_Unknown | |
fOS_IRIX | |
fOS_Solaris | |
fOS_BSD | |
fOS_Darwin | |
fOS_Windows | |
fOS_WindowsServer | |
fOS_Linux |
Definition at line 164 of file ncbi_host_info.h.
enum ESERV_Algo |
Enumerator | |
---|---|
eSERV_Regular | |
eSERV_Blast |
Definition at line 83 of file ncbi_server_info.h.
enum ESERV_Mode |
Enumerator | |
---|---|
fSERV_Stateful | |
fSERV_Secure |
Definition at line 90 of file ncbi_server_info.h.
enum ESERV_Site |
Enumerator | |
---|---|
fSERV_Local | |
fSERV_Private | |
fSERV_Interzone | |
fSERV_ZoneMask |
Definition at line 97 of file ncbi_server_info.h.
enum ESERV_Type |
Enumerator | |
---|---|
fSERV_Ncbid | |
fSERV_Standalone | |
fSERV_HttpGet | |
fSERV_HttpPost | |
fSERV_Http | |
fSERV_Firewall | |
fSERV_Dns |
Definition at line 68 of file ncbi_server_info.h.
enum ESERV_TypeSpecial |
Special "type" bit values that may be combined with server types.
Definition at line 78 of file ncbi_service.h.
Job state.
Enumerator | |
---|---|
eCreated | Initial state, not reported to OnStateChange() |
eQueued | Added to queue (sending temporary postpones) |
eRunning | Ready to send. |
eCompleted | Result: successfully sent. |
eFailed | Result: send failed. |
eCanceled | Result: canceled / removed from queue. |
eRejected | Result: rejected / too many requests. |
Definition at line 378 of file ncbi_usage_report.hpp.
enum CUsageReport::EWait |
Wait behavior.
Enumerator | |
---|---|
eAlways | Always wait (default);. |
eSkipIfNoConnection | Do not try to send remaining jobs in the queue if all previous attempts failed. |
Definition at line 590 of file ncbi_usage_report.hpp.
Defines what information should be reported by default by all reporters, in addition to passed parameters for Send() method.
Enumerator | |
---|---|
fNone | No defaults, all parameters should be specified via CUsageReportParameters directly. |
fAppName | Application name ("appname") |
fAppVersion | Application version ("version") |
fOS | OS name ("os") |
fHost | Host name ("host") |
fDefault |
Definition at line 86 of file ncbi_usage_report.hpp.
CUsageReportParameters & CUsageReportParameters::Add | ( | const string & | name, |
const char * | value | ||
) |
Definition at line 305 of file ncbi_usage_report.cpp.
References CUsageReportParameters::Add(), and rapidjson::value.
CUsageReportParameters & CUsageReportParameters::Add | ( | const string & | name, |
const string & | value | ||
) |
Add argument Name must contain only alphanumeric chars or '_'.
Value will be automatically URL-encoded before printing.
Definition at line 296 of file ncbi_usage_report.cpp.
References NStr::eUrlEnc_URIQueryName, NStr::eUrlEnc_URIQueryValue, CUsageReportParameters::m_Params, NStr::URLEncode(), and rapidjson::value.
Referenced by CUsageReportParameters::Add(), CBlastUsageReport::AddParam(), CUsageReportSampleApp::Pattern_2_MultipleReporters(), and s_AddDefaultParam().
|
inline |
Definition at line 332 of file ncbi_usage_report.hpp.
References CUsageReportParameters::Add(), and rapidjson::value.
Referenced by CUsageReportParameters::Add().
|
static |
Check that connection to reporting URL can be established.
Ignores enable/disable status.
Definition at line 269 of file ncbi_usage_report.cpp.
References CUsageReportAPI::GetURL(), and s_CheckConnection().
Referenced by CUsageReportSampleApp::ConfigureAPI().
bool CUsageReport::CheckConnection | ( | ) |
Check that connection to the reporting URL can be established.
Ignores enable/disable status.
Definition at line 756 of file ncbi_usage_report.cpp.
References CUsageReport::m_URL, and s_CheckConnection().
void CUsageReport::ClearQueue | ( | void | ) |
Remove all unprocessed reporting jobs from queue.
Definition at line 582 of file ncbi_usage_report.cpp.
References MT_GUARD, and CUsageReport::x_ClearQueue().
|
privatedelete |
Prevent copying.
CUsageReport::CUsageReport | ( | TWhat | what = fDefault , |
const string & | url = string() , |
||
unsigned | max_queue_size = 0 |
||
) |
Constructor.
Creates new reporting instance. For general case we still recommend to use a single global usage reporter, one per application, accessible via CUsageReport::Instance(). But, if you need to use different reporting URL or default parameters for each reporter, you can create new instance yourself with needed arguments.
what | Set of parameters that should be reported by default. If fDefault, global default API setting will be used, see CUsageReportAPI::SetDefaultParameters(). |
url | Reporting URL. If not specified or empty, global API setting will be used, see CUsageReportAPI::SetURL(). |
max_queue_size | Maximum reporting jobs queue size. If not specified or zero, global API setting will be used, see CUsageReportAPI::SetMaxQueueSize(). |
Definition at line 432 of file ncbi_usage_report.cpp.
References CUsageReportBase::fAppName, CUsageReportBase::fAppVersion, CUsageReportBase::fDefault, CUsageReportBase::fHost, CUsageReportBase::fOS, CUsageReportAPI::GetAppName(), CUsageReportAPI::GetAppVersion(), CUsageReportAPI::GetDefaultParameters(), CUsageReportAPI::GetMaxQueueSize(), CUsageReportAPI::GetURL(), CUsageReport::m_CountSent, CUsageReport::m_CountTotal, CUsageReport::m_DefaultParams, CUsageReport::m_IsEnabled, CUsageReport::m_IsFinishing, CUsageReport::m_IsWaiting, CUsageReport::m_MaxQueueSize, CUsageReport::m_URL, s_AddDefaultParam(), s_GetHost(), and CUsageReportParameters::ToString().
Referenced by CUsageReport::Instance().
|
inline |
Copy constructor.
Definition at line 407 of file ncbi_usage_report.hpp.
References CUsageReportJob::m_State.
|
inline |
Default constructor.
Definition at line 389 of file ncbi_usage_report.hpp.
Referenced by CUsageReportJob::ReportUsage().
|
inline |
Copy constructor.
Definition at line 338 of file ncbi_usage_report.hpp.
References CUsageReportParameters::x_CopyFrom().
|
inline |
Definition at line 323 of file ncbi_usage_report.hpp.
void CUsageReport::Finish | ( | void | ) |
Finish reporting for the current reporting object.
All jobs in the queue awaiting to be send will be discarded, and reporting thread destroyed. If you want to wait all queued requests to finish as well, please call Wait() just before Finish().
Definition at line 676 of file ncbi_usage_report.cpp.
References CUsageReport::m_IsFinishing, CUsageReport::m_Thread, CUsageReport::m_ThreadSignal, MT_GUARD, and CUsageReport::x_ClearQueue().
Referenced by CUsageReportSampleApp::Pattern_2_MultipleReporters(), CBlastUsageReport::~CBlastUsageReport(), and CUsageReport::~CUsageReport().
|
static |
Definition at line 170 of file ncbi_usage_report.cpp.
References CNcbiApplicationAPI::GetProgramDisplayName(), CNcbiApplicationAPI::InstanceGuard(), and NCBI_PARAM_TYPE.
Referenced by CUsageReport::CUsageReport().
|
static |
Definition at line 183 of file ncbi_usage_report.cpp.
References CNcbiApplicationAPI::GetVersion(), CNcbiApplicationAPI::InstanceGuard(), NCBI_PARAM_TYPE, CVersionInfo::Print(), and dtl::version.
Referenced by CUsageReport::CUsageReport().
|
static |
Definition at line 113 of file ncbi_usage_report.cpp.
References gs_DefaultParams().
Referenced by CUsageReport::CUsageReport().
|
static |
Definition at line 206 of file ncbi_usage_report.cpp.
References NCBI_PARAM_TYPE.
Referenced by CUsageReport::CUsageReport().
unsigned CUsageReport::GetQueueSize | ( | void | ) |
Get number of jobs in the queue – number of unprocessed yet jobs.
Definition at line 571 of file ncbi_usage_report.cpp.
References CUsageReport::m_Queue, and MT_GUARD.
|
static |
Return muximum number of retries in case of error reporting, if specified.
Definition at line 243 of file ncbi_usage_report.cpp.
References NCBI_PARAM_TYPE.
Referenced by s_CheckConnection(), and CUsageReport::x_Send().
|
inline |
Return current job state.
Definition at line 395 of file ncbi_usage_report.hpp.
References CUsageReportJob::m_State.
|
static |
Return timeout for network connection, if specified.
Definition at line 216 of file ncbi_usage_report.cpp.
References CTimeout::eDefault, and NCBI_PARAM_TYPE.
Referenced by s_CheckConnection(), and CUsageReport::x_Send().
|
static |
Definition at line 160 of file ncbi_usage_report.cpp.
References NCBI_PARAM_TYPE.
Referenced by CUsageReportAPI::CheckConnection(), and CUsageReport::CUsageReport().
Definition at line 1291 of file ncbi_heapmgr.c.
References assert, heap, and HEAP_CHECK.
Referenced by s_GetHeapCopy().
SHEAP_Block* HEAP_Alloc | ( | HEAP | heap, |
TNCBI_Size | size, | ||
int | hint | ||
) |
Definition at line 640 of file ncbi_heapmgr.c.
References _HEAP_ALIGN_2, _HEAP_ALIGN_EX, assert, CORE_LOG_X, CORE_LOGF_X, eLOG_Error, eLOG_Warning, f(), head, heap, HEAP_ALIGN, HEAP_BLOCKS, HEAP_CHECK, HEAP_EXTENT, HEAP_ISLAST, HEAP_ISUSED, HEAP_LAST, int, likely, n, SHEAP_HeapBlock::nextfree, SHEAP_HeapBlock::prevfree, s_HEAP_Collect(), s_HEAP_Find(), s_HEAP_Id(), s_HEAP_Take(), s_HEAP_Unlink, ncbi::grid::netcache::search::fields::size, and unlikely.
HEAP HEAP_Attach | ( | const void * | base, |
TNCBI_Size | maxsize, | ||
int | serial | ||
) |
Definition at line 338 of file ncbi_heapmgr.c.
References b, CORE_LOGF_X, eLOG_Error, HEAP_AttachFast(), HEAP_BLOCKS, HEAP_INDEX, HEAP_ISLAST, HEAP_NEXT, HEAP_NEXT_BIT, HEAP_PREV_BIT, HEAP_SIZE, and ncbi::grid::netcache::search::fields::size.
Referenced by s_Shmem_Attach().
HEAP HEAP_AttachFast | ( | const void * | base, |
TNCBI_Size | size, | ||
int | serial | ||
) |
Definition at line 308 of file ncbi_heapmgr.c.
References _HEAP_ALIGN_2, _HEAP_ALIGN_EX, assert, calloc(), CORE_LOGF_X, eLOG_Warning, heap, HEAP_BLOCKS, HEAP_EXTENT, and ncbi::grid::netcache::search::fields::size.
Referenced by HEAP_Attach(), and s_Shmem_Attach().
Definition at line 1333 of file ncbi_heapmgr.c.
References heap, and HEAP_CHECK.
Referenced by LBSM_GetVersion(), LBSM_Shmem_Attach(), LBSM_Shmem_Update(), LBSMD_GetConfig(), LBSMD_GetHostParameter(), s_Close(), s_Fini(), s_GetHeapCopy(), s_GetLocalHostAddress(), s_GetNextInfo(), and s_VerifyChecksum().
Definition at line 1250 of file ncbi_heapmgr.c.
References _HEAP_ALIGN_2, _HEAP_ALIGN_EX, assert, copy(), heap, HEAP_CHECK, HEAP_EXTENT, malloc(), and ncbi::grid::netcache::search::fields::size.
Referenced by s_GetHeapCopy().
HEAP HEAP_Create | ( | void * | base, |
TNCBI_Size | size, | ||
TNCBI_Size | chunk_size, | ||
FHEAP_Resize | resize, | ||
void * | auxarg | ||
) |
Definition at line 261 of file ncbi_heapmgr.c.
References _HEAP_ALIGN_2, _HEAP_ALIGN_EX, assert, b, CORE_LOGF_X, eLOG_Error, eLOG_Warning, heap, HEAP_ALIGN, HEAP_BLOCKS, HEAP_EXTENT, HEAP_LAST, HEAP_SIZE, malloc(), pythonpp::resize(), and ncbi::grid::netcache::search::fields::size.
Referenced by LBSM_Shmem_Create().
Definition at line 1317 of file ncbi_heapmgr.c.
References CORE_LOGF_X, eLOG_Error, heap, HEAP_CHECK, HEAP_Detach(), s_HEAP_Id(), and verify.
Referenced by LBSM_Shmem_Destroy(), s_Fini(), and s_GetHeapCopy().
Definition at line 1304 of file ncbi_heapmgr.c.
References free(), heap, and HEAP_CHECK.
Referenced by HEAP_Destroy(), LBSM_Shmem_Detach(), LBSMD_GetConfig(), LBSMD_GetHostParameter(), s_Close(), and s_GetNextInfo().
void HEAP_Free | ( | HEAP | heap, |
SHEAP_Block * | ptr | ||
) |
Definition at line 819 of file ncbi_heapmgr.c.
References b, CORE_LOG_X, CORE_LOGF_X, eLOG_Error, eLOG_Warning, heap, HEAP_CHECK, HEAP_INDEX, HEAP_ISUSED, HEAP_NEXT, likely, n, s_HEAP_Free(), s_HEAP_Id(), and unlikely.
Referenced by HEAP_FreeFast().
void HEAP_FreeFast | ( | HEAP | heap, |
SHEAP_Block * | ptr, | ||
const SHEAP_Block * | prev | ||
) |
Definition at line 871 of file ncbi_heapmgr.c.
References b, CORE_LOG_X, CORE_LOGF_X, eLOG_Error, eLOG_Warning, heap, HEAP_CHECK, HEAP_Free(), HEAP_INDEX, HEAP_ISUSED, HEAP_NEXT, likely, n, prev(), s_HEAP_fast, s_HEAP_Free(), s_HEAP_Id(), t, and unlikely.
TNCBI_Size HEAP_Idle | ( | const HEAP | heap | ) |
Definition at line 1360 of file ncbi_heapmgr.c.
References assert, b, f(), heap, HEAP_CHECK, HEAP_EXTENT, HEAP_SIZE, and ncbi::grid::netcache::search::fields::size.
SHEAP_Block* HEAP_Next | ( | const HEAP | heap, |
const SHEAP_Block * | prev | ||
) |
Definition at line 1233 of file ncbi_heapmgr.c.
References CORE_LOG_X, eLOG_Warning, heap, HEAP_CHECK, HEAP_ISUSED, n, s_HEAP_Walk(), and unlikely.
Referenced by LBSM_GetConfig(), LBSM_GetVersion(), LBSM_LookupHost(), and LBSM_LookupServiceEx().
Definition at line 1400 of file ncbi_heapmgr.c.
References eOff, eOn, and s_HEAP_fast.
Definition at line 1390 of file ncbi_heapmgr.c.
References heap, and HEAP_CHECK.
Referenced by LBSM_Shmem_Attach(), LBSM_Shmem_Detach(), LBSMD_GetConfig(), LBSMD_GetHostParameter(), s_Close(), s_Fini(), s_GetHeapCopy(), s_GetNextInfo(), and s_IfDaemon().
TNCBI_Size HEAP_Size | ( | const HEAP | heap | ) |
Definition at line 1342 of file ncbi_heapmgr.c.
References heap, HEAP_CHECK, and HEAP_EXTENT.
Referenced by LBSM_Shmem_Update(), and s_VerifyChecksum().
Definition at line 931 of file ncbi_heapmgr.c.
References _HEAP_ALIGN_2, assert, b, CORE_LOGF_X, eLOG_Error, eLOG_Warning, heap, HEAP_BLOCKS, HEAP_CHECK, HEAP_EXTENT, HEAP_INDEX, HEAP_ISLAST, HEAP_ISUSED, HEAP_LAST, likely, prev(), s_HEAP_Collect(), s_HEAP_fast, s_HEAP_Id(), s_HEAP_Link(), and ncbi::grid::netcache::search::fields::size.
TNCBI_Size HEAP_Used | ( | const HEAP | heap | ) |
Definition at line 1351 of file ncbi_heapmgr.c.
References heap, HEAP_CHECK, and HEAP_EXTENT.
SHEAP_Block* HEAP_Walk | ( | const HEAP | heap, |
const SHEAP_Block * | prev | ||
) |
Definition at line 1221 of file ncbi_heapmgr.c.
References CORE_LOG_X, eLOG_Warning, SHEAP_HeapBlock::head, heap, HEAP_CHECK, s_HEAP_Walk(), and unlikely.
Obtain the affinity argument that has keyed the service selection (if argument affinities have been used at all).
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 179 of file ncbi_host_info.c.
References SHostInfoTag::arg, HINFO_MAGIC, and SHostInfoTag::pad.
Obtain the affinity argument's value that has keyed the service selection (if argument affinities have been used at all).
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 187 of file ncbi_host_info.c.
References HINFO_MAGIC, SHostInfoTag::pad, and SHostInfoTag::val.
Get CPU clock rate.
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 105 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_CpuClock(), and SHostInfoTag::pad.
Get CPU count (number of logical cores, hyper-threaded included).
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 89 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_CpuCount(), and SHostInfoTag::pad.
Get physical CPU count (number of physical cores, not packages).
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 97 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_CpuUnits(), and SHostInfoTag::pad.
Obtain and return LB host environment.
LB host environment is a sequence of lines (separated by \n), all having form of "name=value", which is provided to and stored by the Load-Balancing and Service Mapping Daemon (LBSMD) in the configuration file on that host.
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 171 of file ncbi_host_info.c.
References SHostInfoTag::env, HINFO_MAGIC, and SHostInfoTag::pad.
Get the official host address.
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 81 of file ncbi_host_info.c.
References SHostInfoTag::addr, HINFO_MAGIC, and SHostInfoTag::pad.
Obtain host load averages.
host_info | HOST_INFO as returned by the SERV API. |
lavg | Load averages to fill in upon return:
|
Definition at line 151 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_LoadAverage(), and SHostInfoTag::pad.
int HINFO_MachineParams | ( | const HOST_INFO | host_info, |
SHINFO_Params * | params | ||
) |
Get host parameters.
host_info | HOST_INFO as returned by the SERV API. |
params | Host parameters to fill in upon return. |
Definition at line 131 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_MachineParams(), and SHostInfoTag::pad.
Get memory usage data.
host_info | HOST_INFO as returned by the SERV API. |
memusage | Memory usage in MB (filled in upon return):
|
Definition at line 121 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_Memusage(), and SHostInfoTag::pad.
int HINFO_PortUsage | ( | const HOST_INFO | host_info, |
SHINFO_PortUsage | ports[], | ||
size_t | count | ||
) |
Obtain host port usage (currently only 4 first ports are published).
host_info | HOST_INFO as returned by the SERV API. |
ports | Usage information to fill out |
count | Number of array elements in "ports" |
Definition at line 141 of file ncbi_host_info.c.
References count, HINFO_MAGIC, LBSM_HINFO_PortUsage(), and SHostInfoTag::pad.
Obtain LB host availability status.
host_info | HOST_INFO as returned by the SERV API. |
status | Status values to fill in upon return:
|
Definition at line 161 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_Status(), and SHostInfoTag::pad.
Referenced by CDBLB_ServiceMapper::GetServerOptions().
Get task count.
host_info | HOST_INFO as returned by the SERV API. |
Definition at line 113 of file ncbi_host_info.c.
References HINFO_MAGIC, LBSM_HINFO_TaskCount(), and SHostInfoTag::pad.
|
static |
Return global instance of CUsageReport.
This method allow to use a single copy of usage reporter for an application. Real initialization will be done on first call to this method. Newly created reporter inherit current CUsageReportAPI setting, like reporting URL and default parameters. You should change it if necessary before any call to Instance().
Definition at line 417 of file ncbi_usage_report.cpp.
References CUsageReport::CUsageReport(), and gs_DefaultParams().
Referenced by CUsageReportSampleApp::Pattern_3_StatusControl().
|
static |
Indicates whether global application usage statistics collection is enabled.
Definition at line 127 of file ncbi_usage_report.cpp.
References gs_IsEnabled, and NStr::StringToBool().
Referenced by CUsageReport::IsEnabled().
bool CUsageReport::IsEnabled | ( | void | ) |
Indicates whether application usage statistics collection is enabled for a current reporter instance.
Takes into account local status and global API setting as well.
Definition at line 479 of file ncbi_usage_report.cpp.
References CUsageReportAPI::IsEnabled(), CUsageReport::m_IsEnabled, and CUsageReport::m_IsFinishing.
Referenced by CBlastUsageReport::AddParam(), BlastdbCopyApplication::BlastdbCopyApplication(), CBlastDBAliasApp::CBlastDBAliasApp(), CBlastDbCheckApplication::CBlastDbCheckApplication(), CBlastDBCmdApp::CBlastDBCmdApp(), CBlastdbConvertApp::CBlastdbConvertApp(), CBlastFormatterApp::CBlastFormatterApp(), CBlastFormatterVdbApp::CBlastFormatterVdbApp(), CBlastnApp::CBlastnApp(), CBlastpApp::CBlastpApp(), CBlastUsageReport::CBlastUsageReport(), CBlastVdbCmdApp::CBlastVdbCmdApp(), CBlastxApp::CBlastxApp(), CConvert2BlastMaskApplication::CConvert2BlastMaskApplication(), CDeltaBlastApp::CDeltaBlastApp(), CMagicBlastApp::CMagicBlastApp(), CMakeBlastDBApp::CMakeBlastDBApp(), CMakeClusterDBApp::CMakeClusterDBApp(), CMakeProfileDBApp::CMakeProfileDBApp(), CPsiBlastApp::CPsiBlastApp(), CRPSBlastApp::CRPSBlastApp(), CRPSTBlastnApp::CRPSTBlastnApp(), CTblastnApp::CTblastnApp(), CTblastxApp::CTblastxApp(), CVDBBlastnApp::CVDBBlastnApp(), CVDBTblastnApp::CVDBTblastnApp(), CIgBlastnApp::Init(), CIgBlastpApp::Init(), CBlastFormat::LogBlastSearchInfo(), CIgBlastnApp::Run(), CIgBlastpApp::Run(), CUsageReport::Send(), CMagicBlastApp::x_LogBlastSearchInfo(), CUsageReport::x_ThreadHandler(), and CBlastUsageReport::~CBlastUsageReport().
|
inlinevirtual |
Callback for async reporting.
Calls on each state change.
CUsageReport::Send() change job state during asynchronous reporting and call this method on each change. This method can be overloaded to allow checking reporting progress or failures, see EState for a list of states.
Definition at line 404 of file ncbi_usage_report.hpp.
Referenced by CUsageReportJob::x_SetState().
|
privatedelete |
|
inline |
Copy assignment operator.
Definition at line 409 of file ncbi_usage_report.hpp.
References CUsageReportJob::x_CopyFrom().
|
inline |
Copy assignment operator.
Definition at line 340 of file ncbi_usage_report.hpp.
References CUsageReportParameters::x_CopyFrom().
void CUsageReport::Send | ( | CUsageReportParameters & | params | ) |
Report usage statistics (asynchronously).
Send usage statistics with specified parameters in background, without blocking current thread execution.
params | Specifies extra parameters to report, in addition to default parameters specified in the CUsageReport constructor. The reporter copy parameters before asynchronously reporting them in background, so parameters object can be freely changed or destroyed after this call. |
Definition at line 557 of file ncbi_usage_report.cpp.
References CUsageReport::IsEnabled(), and CUsageReport::x_SendAsync().
|
inline |
Report usage statistics (asynchronously) (advanced version).
Send usage statistics in background without blocking current thread execution. You can use this version if you want to control reporting progress and get status of submitted reports.
job | Job to report, some object of type CUsageReportJob or derived from it. CUsageReportJob do nothing if something bad happens on reporting. All errors are ignored and silenced. You need to derive your own class from CUsageReportJob if you want to control reporting status or store additional information. See CUsageReportJob description for details. |
Definition at line 573 of file ncbi_usage_report.hpp.
References CUsageReport::IsEnabled(), and CUsageReport::x_SendAsync().
void CUsageReport::Send | ( | void | ) |
Report usage statistics (asynchronously), default parameters.
Send usage statistics with default parameters in background, without blocking current thread execution.
Definition at line 545 of file ncbi_usage_report.cpp.
References CUsageReport::IsEnabled(), and CUsageReport::x_SendAsync().
Referenced by CUsageReportSampleApp::Pattern_2_MultipleReporters(), CUsageReportSampleApp::Pattern_3_StatusControl(), and CBlastUsageReport::~CBlastUsageReport().
void SERV_Close | ( | SERV_ITER | iter | ) |
Deallocate the iterator.
Must be called to finish the lookup process.
iter | An iterator handle obtained via a "SERV_Open*" call. |
Definition at line 993 of file ncbi_service.c.
References SSERV_VTable::Close, free(), i, SSERV_IterTag::n_skip, SSERV_IterTag::name, SSERV_IterTag::op, SERV_Reset(), and SSERV_IterTag::skip.
Referenced by DBLB_GetServer(), SServIterDeleter::Delete(), CServiceDiscovery::DiscoverImpl(), CDBLB_ServiceMapper::GetServerOptions(), CDBLB_ServiceMapper::GetServersList(), s_CloseDispatcher(), s_Open(), SERV_GetInfoP(), SERV_GetServers(), CConnTest::ServiceOkay(), CConnTest::StatefulOkay(), and x_Open().
SSERV_Info* SERV_CopyInfo | ( | const SSERV_Info * | info | ) |
Definition at line 614 of file ncbi_server_info.c.
References orig, and SERV_CopyInfoEx().
Referenced by CReaderServiceConnector::RememberIfBad().
SSERV_Info* SERV_CreateDnsInfo | ( | unsigned int | host | ) |
Definition at line 1120 of file ncbi_server_info.c.
References SERV_CreateDnsInfoEx().
Referenced by DBLB_GetServer(), s_FakeDnsReturn(), and s_GetNextInfo().
SSERV_Info* SERV_CreateFirewallInfo | ( | unsigned int | host, |
unsigned short | port, | ||
ESERV_Type | type | ||
) |
Definition at line 1057 of file ncbi_server_info.c.
References SERV_CreateFirewallInfoEx().
SSERV_Info* SERV_CreateHttpInfo | ( | ESERV_Type | type, |
unsigned int | host, | ||
unsigned short | port, | ||
const char * | path, | ||
const char * | args | ||
) |
Definition at line 978 of file ncbi_server_info.c.
References SERV_CreateHttpInfoEx().
SSERV_Info* SERV_CreateNcbidInfo | ( | unsigned int | host, |
unsigned short | port, | ||
const char * | args | ||
) |
Definition at line 774 of file ncbi_server_info.c.
References SERV_CreateNcbidInfoEx().
SSERV_Info* SERV_CreateStandaloneInfo | ( | unsigned int | host, |
unsigned short | port | ||
) |
Definition at line 838 of file ncbi_server_info.c.
References SERV_CreateStandaloneInfoEx().
Referenced by DBLB_GetServer().
int SERV_EqualInfo | ( | const SSERV_Info * | info1, |
const SSERV_Info * | info2 | ||
) |
Definition at line 640 of file ncbi_server_info.c.
References SSERV_Info::addr, assert, SSERV_Ops::Equal, SSERV_Info::host, NcbiIsEmptyIPv6(), SSERV_Attr::ops, SSERV_Info::port, s_GetAttrByType(), SSERV_Info::type, and SSERV_Info::u.
Referenced by s_AddServerInfo(), s_AddSkipInfo(), s_GetNextInfo(), SServerScanInfo::SkipServer(), x_AddInfo(), x_ConsistencyCheck(), and x_Finalize().
ESERV_Type SERV_GetImplicitServerType | ( | const char * | service | ) |
Get a server type that would be assigned to typeless entries for the given service name.
Definition at line 1300 of file ncbi_service.c.
SSERV_Info* SERV_GetInfo | ( | const char * | service, |
TSERV_Type | types, | ||
unsigned int | preferred_host, | ||
const SConnNetInfo * | net_info | ||
) |
Same as "SERV_GetInfoEx(., ., ., ., 0, 0, 0)" – i.e.
w/o the "skip" array, and w/o "host_info".
Definition at line 872 of file ncbi_service.c.
References SERV_GetInfoP(), and types.
Referenced by CEUtils_Request::GetBaseURL(), and CEutilsClient::x_GetHostName().
SSERV_Info* SERV_GetInfoEx | ( | const char * | service, |
TSERV_Type | types, | ||
unsigned int | preferred_host, | ||
const SConnNetInfo * | net_info, | ||
SSERV_InfoCPtr | skip[], | ||
size_t | n_skip, | ||
HOST_INFO * | host_info | ||
) |
A "fast track" routine equivalent to creating of an iterator as with SERV_OpenEx(), and then taking an info as with SERV_GetNextInfoEx().
However, this call is optimized for an application, which only needs a single entry (the first one), and which is not interested in iterating over all available instances. Both the returned server-info and host information (if any) have to be explicitly free()'d by the application when no longer needed.
service | A service name (may not be NULL or empty). |
types | A bitset of type(s) of servers requested. |
preferred_host | Preferred host to use the service at, nbo. |
net_info | Connection information (NULL disables network-based dispatching via LINKERD, NAMERD, and DISPD) |
skip[] | An array of servers NOT to select, see SERV_OpenEx() for notes. |
n_skip | Number of entries in the "skip" array. |
host_info | An optional pointer to store host info at (may be NULL). |
Definition at line 886 of file ncbi_service.c.
References SERV_GetInfoP(), and types.
SSERV_Info* SERV_GetInfoSimple | ( | const char * | service | ) |
Equivalent to "SERV_GetInfo(., fSERV_Any, SERV_ANYHOST, ConnNetInfo_Create(service))", but it takes care not to leak its last "net_info" parameter, which it builds on the fly.
Definition at line 858 of file ncbi_service.c.
References ConnNetInfo_Create(), ConnNetInfo_Destroy(), fSERV_Any, info, SERV_ANYHOST, and SERV_GetInfoP().
SSERV_InfoCPtr SERV_GetNextInfo | ( | SERV_ITER | iter | ) |
Same as "SERV_GetNextInfoEx(., 0)" – i.e.
w/o the host information.
Definition at line 936 of file ncbi_service.c.
References assert, SSERV_IterTag::op, and s_GetNextInfo().
Referenced by DBLB_GetServer(), CDBLB_ServiceMapper::GetServersList(), s_GetNextInfo(), LbsmLookup::s_Resolve(), s_ScanInfoGetNextInfo(), SERV_GetServers(), CConnTest::ServiceOkay(), CConnTest::StatefulOkay(), CDBLBClientApp::x_RunWhatIs(), and CDBLBClientApp::x_RunWhereIs().
SSERV_InfoCPtr SERV_GetNextInfoEx | ( | SERV_ITER | iter, |
HOST_INFO * | host_info | ||
) |
Get the next server meta-address, optionally accompanied by the host parameters made available by the LB daemon (LBSMD).
iter | An iterator handle obtained via a "SERV_Open*" call. |
host_info | An optional pointer to store host info at (may be NULL). |
Definition at line 928 of file ncbi_service.c.
References assert, SSERV_IterTag::op, and s_GetNextInfo().
Referenced by CServiceDiscovery::DiscoverImpl(), and CDBLB_ServiceMapper::GetServerOptions().
SERV_ITER SERV_Open | ( | const char * | service, |
TSERV_Type | types, | ||
unsigned int | preferred_host, | ||
const SConnNetInfo * | net_info | ||
) |
Same as "SERV_OpenEx(., ., ., ., 0, 0)" – i.e.
w/o the "skip" array.
Definition at line 809 of file ncbi_service.c.
References s_Open(), and types.
Referenced by DBLB_GetServer(), CDBLB_ServiceMapper::GetServerOptions(), CDBLB_ServiceMapper::GetServersList(), s_OpenDispatcher(), LbsmLookup::s_Resolve(), SERV_GetServers(), CDBLBClientApp::x_RunWhatIs(), and CDBLBClientApp::x_RunWhereIs().
SERV_ITER SERV_OpenEx | ( | const char * | service, |
TSERV_Type | types, | ||
unsigned int | preferred_host, | ||
const SConnNetInfo * | net_info, | ||
SSERV_InfoCPtr | skip[], | ||
size_t | n_skip | ||
) |
Create an iterator for sequential server lookup.
service | A service name, may not be NULL or empty. |
types | A bitset of type(s) of servers requested. |
preferred_host | Preferred host to use the service at, nbo. |
net_info | Connection information (NULL prevents the use of the network-based dispatching via LINKERD, NAMERD, and DISPD) |
skip | An array of servers NOT to select: contains server-info elements that are not to return from the search (whose server-infos match the would-be result). |
n_skip | Number of entries in the "skip" array. |
Definition at line 822 of file ncbi_service.c.
Allocate an iterator and consult either local databases (if any present), or network database, using all default communication parameters found both in the registry and the environment variables (as if having an implicit parameter "net_info" created with "ConnNetInfo_Create(service)").
service | A service name (may not be NULL or empty). |
Definition at line 795 of file ncbi_service.c.
References ConnNetInfo_Create(), ConnNetInfo_Destroy(), fSERV_Any, s_Open(), and SERV_ANYHOST.
Referenced by CConnTest::ServiceOkay(), and CConnTest::StatefulOkay().
Penalize the server returned last from SERV_GetNextInfo[Ex]().
iter | An iterator handle obtained via a "SERV_Open*" call. |
fine | A fine value in the range [0=min..100=max] (%%), inclusive. |
Definition at line 966 of file ncbi_service.c.
References SERV_PenalizeEx().
SSERV_Info* SERV_ReadInfo | ( | const char * | info_str | ) |
Definition at line 587 of file ncbi_server_info.c.
References SERV_ReadInfoEx(), and str().
const char* SERV_ReadType | ( | const char * | str, |
ESERV_Type * | type | ||
) |
Definition at line 129 of file ncbi_server_info.c.
References SSERV_Attr::len, s_GetAttrByTag(), str(), and SSERV_Attr::type.
Referenced by s_Firewall_Read(), s_ParseResponse(), SERV_ReadInfoEx(), and CDBLBClientApp::x_RunWhereIs().
Rerate the server returned last from SERV_GetNextInfo[Ex]().
iter | An iterator handle obtained via a "SERV_Open*" call. |
rate | A new rate value, or 0.0 to turn the server off, or fabs(rate) >= LBSM_RERATE_DEFAULT to revert to the default. |
Definition at line 972 of file ncbi_service.c.
References assert, SSERV_VTable::Feedback, SSERV_IterTag::last, and SSERV_IterTag::op.
void SERV_Reset | ( | SERV_ITER | iter | ) |
Reset the iterator to the state as if it has just been opened.
iter | An iterator handle obtained via a "SERV_Open*" call. |
Definition at line 981 of file ncbi_service.c.
References SSERV_IterTag::last, SSERV_IterTag::op, SSERV_VTable::Reset, s_SkipSkip(), and SSERV_IterTag::time.
Referenced by s_GetNextInfo(), and SERV_Close().
Obtain a port number that corresponds to the named (standalone) service declared at the specified host (per the LB configuration information).
name | Service name (of type fSERV_Standalone) to look up. |
host | Host address (or SERV_LOCALHOST, or 0, same) to look the service up at. |
Definition at line 1200 of file ncbi_service.c.
References assert, eDefault, free(), fSERV_Promiscuous, fSERV_Standalone, info, SERV_GetInfoP(), SERV_LOCALHOST, and SOCK_GetLocalHostAddress().
int SERV_SetImplicitServerType | ( | const char * | service, |
ESERV_Type | type | ||
) |
Set a server type to use when a service mapper returns typeless entries for the given service name (typed entries retain their types as received).
Definition at line 1227 of file ncbi_service.c.
References buf, CONN_IMPLICIT_SERVER_TYPE, CORE_LOCK_WRITE, CORE_REG_SET, CORE_UNLOCK, eREG_Transient, free(), len, putenv, SERV_ServiceName(), SERV_TypeStr(), setenv, strupr, and x_tr().
size_t SERV_SizeOfInfo | ( | const SSERV_Info * | info | ) |
Definition at line 628 of file ncbi_server_info.c.
References info, SSERV_Attr::ops, s_GetAttrByType(), and SSERV_Ops::SizeOf.
Referenced by SERV_CopyInfoEx(), SERV_NameOfInfo(), and SERV_ReadInfoEx().
const char* SERV_TypeStr | ( | ESERV_Type | type | ) |
Definition at line 122 of file ncbi_server_info.c.
References s_GetAttrByType(), and SSERV_Attr::tag.
Referenced by LBSM_SubmitPenaltyOrRerate(), s_Firewall_Write(), s_LookupHost(), s_ParseResponse(), s_Resolve(), SERV_GetServers(), SERV_Print(), SERV_SetImplicitServerType(), CDBLBClientApp::x_InitWhereIs(), CDBLBClientApp::x_RunWhatIs(), and CDBLBClientApp::x_RunWhereIs().
char* SERV_WriteInfo | ( | const SSERV_Info * | info | ) |
Definition at line 145 of file ncbi_server_info.c.
References assert, CONN_CONTENT_TYPE_LEN, eSERV_Blast, eSERV_Regular, fabs, free(), fSERV_Dns, fSERV_Http, fSERV_Interzone, fSERV_Local, fSERV_Private, fSERV_Secure, fSERV_Stateful, if(), info, SSERV_Attr::len, MAX_IP_ADDR_LEN, memmove, MIME_ComposeContentTypeEx(), n, NCBI_simple_ftoa(), NcbiAddrToString(), NcbiIsIPv4(), SSERV_Attr::ops, s_GetAttrByType(), ncbi::grid::netcache::search::fields::size, SSERV_Ops::SizeOf, SOCK_HostPortToString(), SOCK_HostToNetLong(), str(), SSERV_Attr::tag, and SSERV_Ops::Write.
Referenced by s_GetNextInfo(), SERV_Print(), x_AddInfo(), x_ConsistencyCheck(), x_Finalize(), and x_SetupFromNamerd().
Set application name for the usage reporters.
If CNcbiApplication is used, all usage reporters automatically use program name specified there, if it is not empty, and this call doesn't have any effect. Otherwise, specified application name will be used by all reporters, created afterwards.
Definition at line 165 of file ncbi_usage_report.cpp.
References NCBI_PARAM_TYPE.
Referenced by CUsageReportSampleApp::ConfigureAPI().
|
static |
Definition at line 201 of file ncbi_usage_report.cpp.
References CUsageReportAPI::SetAppVersion(), and dtl::version.
Set application version for the usage reporter(s).
If CNcbiApplication is used, all usage reporters automatically use application's version specified there, if it is not empty, and this call doesn't have any effect. Otherwise, specified value will be used by all reporters, created afterwards.
Definition at line 196 of file ncbi_usage_report.cpp.
References NCBI_PARAM_TYPE, and dtl::version.
Referenced by CUsageReportSampleApp::ConfigureAPI(), and CUsageReportAPI::SetAppVersion().
Set default reporting parameters.
Allow to change default reporting parameters, that will be automatically added to each usage report. Should be used before creating CUsageReport object or any CUsageReport::Instance() usage. Doesn't affect already created reporters.
what | New set of parameters, that should be reported by default by all newly created reporters. |
Definition at line 108 of file ncbi_usage_report.cpp.
References gs_DefaultParams().
Referenced by CUsageReportSampleApp::ConfigureAPI().
Enable or disable usage statistics reporting globally for all reporters.
This is an only an API method that affects all reporters, even already created. Also, you can enable/disable reporting for each reporter separately, but only if global API is enabled. Global settings have a priority over local status of any reporter.
Definition at line 148 of file ncbi_usage_report.cpp.
References gs_IsEnabled.
Referenced by CUsageReportSampleApp::ConfigureAPI(), and CBlastUsageReport::x_CheckBlastUsageEnv().
Enable or disable usage reporter (current instance only).
Note, global API settings have a priority, and if disabled, overrides enable status for the current instance.
Definition at line 517 of file ncbi_usage_report.hpp.
References CUsageReport::m_IsEnabled.
Referenced by CBlastUsageReport::x_CheckBlastUsageEnv(), and CUsageReport::x_SendAsync().
|
static |
Declare the maximum reporting jobs queue size per reporter.
Minimum value is 1. Value 0 sets queue to predefined size. Maximum value is unspecified, but be aware that too big queue size takes more memory and affects reporting accuracy. All requests processes on first-in-first-out base, and if queue is almost full, some newly added reports can become obsolete before the reporter can send it to server.
Affects all reporters created afterwards only. Used by CUsageReport::Send() method.
Maximum | number of reporting jobs in the queue per reporter. 0 - (re)set to default value. |
Definition at line 211 of file ncbi_usage_report.cpp.
References kDefault_MaxQueueSize, n, and NCBI_PARAM_TYPE.
Referenced by CUsageReportSampleApp::ConfigureAPI().
|
static |
Set muximum number of retries in case of error reporting.
By default CUsageReport uses number of tries specified for the Connect API. This call allow ro override default Connect API values, or specified using $CONN_MAX_TRY environment variable, or [CONN]MAX_TRY registry value. Zero number mean no-retries, so any connection will be tried to establish only once. Any negative value set default number of tries specified for the Connect API.
Definition at line 248 of file ncbi_usage_report.cpp.
References NCBI_PARAM_TYPE.
Referenced by CBlastUsageReport::CBlastUsageReport(), and CUsageReportSampleApp::ConfigureAPI().
Set timeout for connection.
By default CUsageReport uses connection timeout specified for the Connect API. This call allow to override default Connect API values, or specified using $CONN_TIMEOUT environment variable, or [CONN]TIMEOUT registry value. Allow any timeout values except eInfinite.
Definition at line 225 of file ncbi_usage_report.cpp.
References CTimeout::GetAsDouble(), CTimeout::IsDefault(), CTimeout::IsFinite(), CTimeout::IsZero(), kDefault_ConnTimeout, NCBI_PARAM_TYPE, and NCBI_THROW.
Referenced by CBlastUsageReport::CBlastUsageReport(), and CUsageReportSampleApp::ConfigureAPI().
Change CGI URL for reporting usage statistics.
Doesn't affect already created reporters.
Definition at line 155 of file ncbi_usage_report.cpp.
References NCBI_PARAM_TYPE.
Referenced by BOOST_AUTO_TEST_CASE(), and CUsageReportSampleApp::ConfigureAPI().
string CUsageReportParameters::ToString | ( | void | ) | const |
Convert parameters to string. URL-encode all values.
Definition at line 310 of file ncbi_usage_report.cpp.
References first(), CUsageReportParameters::m_Params, and result.
Referenced by CUsageReport::CUsageReport(), and CUsageReport::x_ThreadHandler().
void CUsageReport::Wait | ( | EWait | how = eAlways , |
CTimeout | timeout = CTimeout(CTimeout::eDefault) |
||
) |
Wait until all queued jobs starts to process and queue is empty.
Can be called before Finish() to be sure that all queued requests are processed and nothing is discarded.
now | Specify what to do in the case if no inernet connection detected, and all previos jobs were failed to be reported. By default it will try to send jobs until queue is empty. But you have an option to skip remaining jobs in the queue and just exit from the function. All jobs will remain in the queue, awaiting to be reported until you call Finish() or ClearQueue(). |
timeout | Specifies a timeout to wait. By default, if not redefined, the timeout is infinite. Default value can be redefined using the global parameter: Registry file: [USAGE_REPORT] WaitTimeout = <float-number-in-seconds> Environment variable: NCBI_USAGE_REPORT_WAIT_TIMEOUT=<float-number-in-seconds> Negative value sets infinite timeout. |
Waiting time depends on a connection timeout, and can be greater than specified 'timeout'. Real waiting time is a maximum of 'timeout' and connection timeout, see CUsageReport::SetTimeout().
Definition at line 603 of file ncbi_usage_report.cpp.
References CTimeout::eInfinite, CTimeout::IsDefault(), CUsageReport::m_IsFinishing, CUsageReport::m_IsWaiting, CUsageReport::m_Queue, CUsageReport::m_ThreadSignal, CUsageReport::m_ThreadSignal_Mutex, CUsageReport::m_WaitDeadline, CUsageReport::m_WaitMode, MT_GUARD, NCBI_PARAM_TYPE, and CTimeout::Set().
Referenced by CUsageReportSampleApp::Pattern_2_MultipleReporters(), and CBlastUsageReport::~CBlastUsageReport().
|
private |
Remove all unprocessed reporting jobs from queue - internal version.
Definition at line 591 of file ncbi_usage_report.cpp.
References CUsageReportJob::eCanceled, and CUsageReport::m_Queue.
Referenced by CUsageReport::ClearQueue(), CUsageReport::Finish(), and CUsageReport::x_ThreadHandler().
|
protected |
Copy data from 'other' job.
Definition at line 346 of file ncbi_usage_report.cpp.
References CUsageReportJob::m_State, and CUsageReportParameters::x_CopyFrom().
Referenced by CUsageReportJob::operator=().
|
protected |
Copy parameters to another objects.
Definition at line 328 of file ncbi_usage_report.cpp.
References CUsageReportParameters::m_Params.
Referenced by CUsageReportParameters::CUsageReportParameters(), CUsageReportParameters::operator=(), and CUsageReportJob::x_CopyFrom().
Send parameters string synchronously.
Definition at line 489 of file ncbi_usage_report.cpp.
References CHttpSession_Base::Get(), CUsageReportAPI::GetRetries(), CHttpResponse::GetStatusCode(), CUsageReportAPI::GetTimeout(), CUsageReport::m_DefaultParams, and CUsageReport::m_URL.
Referenced by CUsageReport::x_ThreadHandler().
|
private |
Send job asynchronously.
Definition at line 512 of file ncbi_usage_report.cpp.
References _ASSERT, CUsageReportJob::eQueued, CUsageReportJob::eRejected, ERR_POST_ONCE, CUsageReport::m_MaxQueueSize, CUsageReport::m_Queue, CUsageReport::m_Thread, CUsageReport::m_ThreadSignal, MT_GUARD, CUsageReport::SetEnabled(), Warning(), CUsageReportJob::x_SetState(), and CUsageReport::x_ThreadHandler().
Referenced by CUsageReport::Send().
|
protected |
Set new job state.
Used by CUsageReport::Send() only. User cannot change state directly.
Definition at line 340 of file ncbi_usage_report.cpp.
References CUsageReportJob::m_State, and CUsageReportJob::OnStateChange().
Referenced by CUsageReport::x_SendAsync(), and CUsageReport::x_ThreadHandler().
|
private |
Thread handler for asynchronous job reporting.
Definition at line 696 of file ncbi_usage_report.cpp.
References CUsageReportJob::eCompleted, CUsageReportJob::eFailed, CUsageReportJob::eRunning, CUsageReport::eSkipIfNoConnection, CUsageReport::IsEnabled(), CDeadline::IsExpired(), CUsageReport::m_CountSent, CUsageReport::m_CountTotal, CUsageReport::m_IsFinishing, CUsageReport::m_IsWaiting, CUsageReport::m_Queue, CUsageReport::m_ThreadSignal, CUsageReport::m_ThreadSignal_Mutex, CUsageReport::m_WaitDeadline, CUsageReport::m_WaitMode, MT_GUARD, CUsageReportParameters::ToString(), CUsageReport::x_ClearQueue(), CUsageReport::x_Send(), and CUsageReportJob::x_SetState().
Referenced by CUsageReport::x_SendAsync().
|
virtual |
Destructor.
Clean up the reporter, call Finish(), all queued and non-sent reporting jobs will be destroyed.
Definition at line 472 of file ncbi_usage_report.cpp.
References CUsageReport::Finish().
|
inlinevirtual |
Destructor.
Definition at line 391 of file ncbi_usage_report.hpp.
char SSERV_StandaloneInfo::_pad |
Definition at line 131 of file ncbi_server_info.h.
TNCBI_IPv6Addr SSERV_Info::addr |
Definition at line 173 of file ncbi_server_info.h.
Referenced by SERV_EqualInfo(), and x_UpdateHost().
TSERV_Algo SSERV_Info::algo |
Definition at line 172 of file ncbi_server_info.h.
Referenced by CDBLB_ServiceMapper::GetServerOptions(), and s_GetNextInfo().
TNcbiArch SHINFO_Params::arch |
Architecture ID, see enum, 0=unknown.
Definition at line 179 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
TNCBI_Size SSERV_NcbidInfo::args |
Definition at line 126 of file ncbi_server_info.h.
TNCBI_Size SSERV_HttpInfo::args |
Definition at line 136 of file ncbi_server_info.h.
TNcbiCapacity SHINFO_Params::bits |
Platform bitness, 32/64/32+64/0=unknown.
Definition at line 180 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
TNCBI_Time SHINFO_Params::bootup |
System boot time, time_t-compatible.
Definition at line 188 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
double SSERV_Info::coef |
Definition at line 167 of file ncbi_server_info.h.
struct { ... } SHINFO_Params::daemon |
LBSMD daemon version.
Referenced by LBSM_HINFO_MachineParams().
SSERV_DnsInfo USERV_Info::dns |
Definition at line 157 of file ncbi_server_info.h.
Referenced by s_Dns_SizeOf().
unsigned short SSERV_Info::extra |
Definition at line 175 of file ncbi_server_info.h.
SSERV_FirewallInfo USERV_Info::firewall |
Definition at line 156 of file ncbi_server_info.h.
Referenced by s_AddSkipInfo(), s_Firewall_Equal(), s_Firewall_SizeOf(), s_Firewall_Write(), and s_GetNextInfo().
unsigned int SHEAP_Block::flag |
Definition at line 59 of file ncbi_heapmgr.h.
Referenced by LBSMD_GetLocalHostAddress(), and s_HEAP_Free().
unsigned int SSERV_Info::host |
Definition at line 162 of file ncbi_server_info.h.
Referenced by DBLB_GetServer(), CDBLB_ServiceMapper::GetServerOptions(), CDBLB_ServiceMapper::GetServersList(), LBSM_LookupServiceEx(), s_GetNextInfo(), s_LookupHost(), s_SkipSkip(), SERV_EqualInfo(), x_Finalize(), CDBLBClientApp::x_RunWhatIs(), CDBLBClientApp::x_RunWhereIs(), and x_UpdateHost().
SSERV_HttpInfo USERV_Info::http |
Definition at line 155 of file ncbi_server_info.h.
Referenced by s_Http_Equal(), s_Http_SizeOf(), and s_Http_Write().
struct { ... } SHINFO_Params::kernel |
Kernel/OS version #, if available.
Referenced by LBSM_HINFO_MachineParams().
|
private |
Statistics: number of jobs successfully sent.
Definition at line 676 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CUsageReport(), and CUsageReport::x_ThreadHandler().
|
private |
Statistics: number of jobs processed.
Definition at line 675 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CUsageReport(), and CUsageReport::x_ThreadHandler().
|
private |
Default parameters to report, concatenated and URL-encoded.
Definition at line 669 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CUsageReport(), and CUsageReport::x_Send().
|
mutableprivate |
Enable/disable status.
Definition at line 664 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CUsageReport(), CUsageReport::IsEnabled(), and CUsageReport::SetEnabled().
|
mutableprivate |
TRUE if Finish() has called and reporting thread should terminate.
Definition at line 667 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CUsageReport(), CUsageReport::Finish(), CUsageReport::IsEnabled(), CUsageReport::Wait(), and CUsageReport::x_ThreadHandler().
|
mutableprivate |
TRUE if Wait() is active.
Definition at line 668 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CUsageReport(), CUsageReport::Wait(), and CUsageReport::x_ThreadHandler().
|
private |
Maximum allowed queue size.
Definition at line 673 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CUsageReport(), and CUsageReport::x_SendAsync().
Stored parameters.
Definition at line 347 of file ncbi_usage_report.hpp.
Referenced by CUsageReportParameters::Add(), CUsageReportParameters::ToString(), and CUsageReportParameters::x_CopyFrom().
|
private |
Job queue.
Definition at line 672 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::GetQueueSize(), CUsageReport::Wait(), CUsageReport::x_ClearQueue(), CUsageReport::x_SendAsync(), and CUsageReport::x_ThreadHandler().
|
private |
Job state.
Definition at line 421 of file ncbi_usage_report.hpp.
Referenced by CUsageReportJob::CUsageReportJob(), CUsageReportJob::GetState(), CUsageReportJob::x_CopyFrom(), and CUsageReportJob::x_SetState().
|
private |
Reporting thread.
Definition at line 671 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::Finish(), and CUsageReport::x_SendAsync().
|
private |
Signal conditional variable for reporting thread synchronization.
Definition at line 681 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::Finish(), CUsageReport::Wait(), CUsageReport::x_SendAsync(), and CUsageReport::x_ThreadHandler().
|
private |
Definition at line 682 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::Wait(), and CUsageReport::x_ThreadHandler().
|
private |
Reporting URL.
Definition at line 670 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::CheckConnection(), CUsageReport::CUsageReport(), and CUsageReport::x_Send().
|
private |
MT-protection to access members.
Definition at line 674 of file ncbi_usage_report.hpp.
|
private |
Deadline for Wait(), if active.
Definition at line 678 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::Wait(), and CUsageReport::x_ThreadHandler().
|
private |
Waiting mode.
Definition at line 677 of file ncbi_usage_report.hpp.
Referenced by CUsageReport::Wait(), and CUsageReport::x_ThreadHandler().
unsigned { ... } ::major |
Definition at line 183 of file ncbi_host_info.h.
unsigned short SHINFO_Params::major |
Definition at line 183 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
unsigned { ... } ::major |
Definition at line 191 of file ncbi_host_info.h.
EMIME_Encoding SSERV_Info::mime_e |
Definition at line 171 of file ncbi_server_info.h.
EMIME_SubType SSERV_Info::mime_s |
Definition at line 170 of file ncbi_server_info.h.
EMIME_Type SSERV_Info::mime_t |
Definition at line 169 of file ncbi_server_info.h.
unsigned { ... } ::minor |
Definition at line 184 of file ncbi_host_info.h.
unsigned short SHINFO_Params::minor |
Definition at line 184 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
unsigned { ... } ::minor |
Definition at line 192 of file ncbi_host_info.h.
TSERV_Mode SSERV_Info::mode |
Definition at line 164 of file ncbi_server_info.h.
Referenced by s_GetNextInfo().
unsigned char SSERV_DnsInfo::name |
Definition at line 146 of file ncbi_server_info.h.
SSERV_NcbidInfo USERV_Info::ncbid |
Definition at line 153 of file ncbi_server_info.h.
Referenced by s_Ncbid_Equal(), s_Ncbid_SizeOf(), and s_Ncbid_Write().
TNcbiOSType SHINFO_Params::ostype |
OS type ID, see enum, 0=unknown.
Definition at line 181 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
unsigned { ... } ::patch |
Definition at line 185 of file ncbi_host_info.h.
unsigned short SHINFO_Params::patch |
Definition at line 185 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
unsigned { ... } ::patch |
Definition at line 193 of file ncbi_host_info.h.
TNCBI_Size SSERV_HttpInfo::path |
Definition at line 135 of file ncbi_server_info.h.
size_t SHINFO_Params::pgsize |
Hardware page size in bytes, if known.
Definition at line 187 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
unsigned short SHINFO_PortUsage::port |
Port number, host byte order.
Definition at line 215 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_PortUsage().
unsigned short SSERV_Info::port |
Definition at line 163 of file ncbi_server_info.h.
Referenced by DBLB_GetServer(), dns_srv(), CDBLB_ServiceMapper::GetServerOptions(), CDBLB_ServiceMapper::GetServersList(), s_GetNextInfo(), SERV_EqualInfo(), x_Finalize(), CDBLBClientApp::x_RunWhatIs(), and CDBLBClientApp::x_RunWhereIs().
double SSERV_Info::rate |
Definition at line 168 of file ncbi_server_info.h.
Referenced by dns_srv(), CDBLB_ServiceMapper::GetServerOptions(), s_GetNextInfo(), s_LookupHost(), s_SortStandbys(), and CDBLBClientApp::x_RunWhereIs().
TSERV_Site SSERV_Info::site |
Definition at line 165 of file ncbi_server_info.h.
Referenced by s_GetNextInfo().
TNCBI_Size SHEAP_Block::size |
Definition at line 61 of file ncbi_heapmgr.h.
Referenced by LBSMD_GetLocalHostAddress(), s_HEAP_Find(), s_HEAP_Free(), s_HEAP_Link(), s_Localhost(), and x_HEAP_Walk().
SSERV_StandaloneInfo USERV_Info::standalone |
Definition at line 154 of file ncbi_server_info.h.
Referenced by s_Standalone_SizeOf().
TNCBI_Time SHINFO_Params::startup |
LBSMD start time, time_t-compatible.
Definition at line 189 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
unsigned short SHINFO_Params::svcpack |
Kernel service pack (Hi=major, Lo=minor)
Definition at line 195 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_MachineParams().
TNCBI_Time SSERV_Info::time |
Definition at line 166 of file ncbi_server_info.h.
Referenced by dns_srv(), CDBLB_ServiceMapper::GetServerOptions(), CDBLB_ServiceMapper::GetServersList(), s_GetNextInfo(), s_SkipSkip(), x_Finalize(), and x_Open().
ESERV_Type SSERV_FirewallInfo::type |
Definition at line 142 of file ncbi_server_info.h.
Referenced by s_AddSkipInfo(), s_Firewall_Equal(), s_Firewall_Write(), and s_GetNextInfo().
ESERV_Type SSERV_Info::type |
Definition at line 161 of file ncbi_server_info.h.
Referenced by s_AddSkipInfo(), s_GetNextInfo(), s_LookupHost(), s_SkipSkip(), s_Sort(), SERV_EqualInfo(), x_Finalize(), x_Open(), CDBLBClientApp::x_RunWhatIs(), and CDBLBClientApp::x_RunWhereIs().
USERV_Info SSERV_Info::u |
Definition at line 176 of file ncbi_server_info.h.
Referenced by s_AddSkipInfo(), s_GetNextInfo(), and SERV_EqualInfo().
double SHINFO_PortUsage::used |
Port usage as percentage, [0..100].
Definition at line 216 of file ncbi_host_info.h.
Referenced by LBSM_HINFO_PortUsage().
unsigned char SSERV_Info::vhost |
Definition at line 174 of file ncbi_server_info.h.
|
friend |
Definition at line 349 of file ncbi_usage_report.hpp.
|
friend |
Definition at line 423 of file ncbi_usage_report.hpp.
|
friend |
Definition at line 649 of file ncbi_usage_report.hpp.