Couchbase C Client
2.4.4
|
Functions | |
lcb_stat_callback | lcb_set_stat_callback (lcb_t, lcb_stat_callback) |
lcb_error_t | lcb_server_stats (lcb_t instance, const void *command_cookie, lcb_SIZE num, const lcb_server_stats_cmd_t *const *commands) |
Request server statistics. More... | |
Typedefs | |
typedef void(* | lcb_stat_callback )(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp) |
The callback function for a stat request. More... | |
lcb_error_t lcb_server_stats | ( | lcb_t | instance, |
const void * | command_cookie, | ||
lcb_SIZE | num, | ||
const lcb_server_stats_cmd_t *const * | commands | ||
) |
Request server statistics.
Without a key specified the server will respond with a "default" set of statistics information. Each piece of statistical information is returned in its own packet (key contains the name of the statistical item and the body contains the value in ASCII format). The sequence of return packets is terminated with a packet that contains no key and no value.
The command will signal about transfer completion by passing NULL as the server endpoint and 0 for key length. Note that key length will be zero when some server responds with error. In latter case server endpoint argument will indicate the server address.
instance | the instance used to batch the requests from |
command_cookie | a cookie passed to all of the notifications from this command |
num | the total number of elements in the commands array |
commands | the array containing the statistic to get |
struct lcb_STATSRESPv0 |
Per-server, per-stat response structure for lcb_server_stats()
This structure is returned for each statistic requested by lcb_server_stats(). As both the number of servers replying to this function as well as the number of stats per server is variable, the application should pay attention to the following semantics:
server_endpoint
and key
being non-NULL
key
and bytes
fields will be NULL.server_endpoint
field set to NULL
.It is recommended to index statistics twice; first based on the server_endpoint
field and then on the key
field. It is likely that the same key
will be received multiple times for different server_endpoints
.
Data Fields | ||
---|---|---|
const char * | server_endpoint | Server which the statistic is from. |
const void * | key | Statistic name. |
lcb_SIZE | nkey | |
const void * | bytes | Statistic value. |
lcb_SIZE | nbytes |
struct lcb_server_stat_resp_t |
Wrapper structure for lcb_STATSRESPv0.
Data Fields | ||
---|---|---|
int | version | |
union lcb_server_stat_resp_t | v |
typedef void(* lcb_stat_callback)(lcb_t instance, const void *cookie, lcb_error_t error, const lcb_server_stat_resp_t *resp) |
The callback function for a stat request.
instance | the instance performing the operation |
cookie | the cookie associated with with the command |
error | The status of the operation |
resp | response data |