NATS C Client with JetStream and Streaming support  3.9.1
The nats.io C Client, Supported by Synadia Communications Inc.
Statistics

Functions

NATS_EXTERN natsStatus natsStatistics_Create (natsStatistics **newStats)
 Creates a natsStatistics object. More...
 
NATS_EXTERN natsStatus natsStatistics_GetCounts (const natsStatistics *stats, uint64_t *inMsgs, uint64_t *inBytes, uint64_t *outMsgs, uint64_t *outBytes, uint64_t *reconnects)
 Extracts the various statistics values. More...
 
NATS_EXTERN void natsStatistics_Destroy (natsStatistics *stats)
 Destroys the natsStatistics object. More...
 

Detailed Description

Statistics Functions.

Function Documentation

◆ natsStatistics_Create()

NATS_EXTERN natsStatus natsStatistics_Create ( natsStatistics **  newStats)

Creates a statistics object that can be passed to natsConnection_GetStats().

Note
The object needs to be destroyed when no longer needed.
See also
natsStatistics_Destroy()
Parameters
newStatsthe location where to store the pointer to the newly created natsStatistics object.

◆ natsStatistics_GetCounts()

NATS_EXTERN natsStatus natsStatistics_GetCounts ( const natsStatistics stats,
uint64_t *  inMsgs,
uint64_t *  inBytes,
uint64_t *  outMsgs,
uint64_t *  outBytes,
uint64_t *  reconnects 
)

Gets the counts out of the statistics object.

Note
You can pass NULL to any of the count your are not interested in getting.
See also
natsConnection_GetStats()
Parameters
statsthe pointer to the natsStatistics object to get the values from.
inMsgstotal number of inbound messages.
inBytestotal size (in bytes) of inbound messages.
outMsgstotal number of outbound messages.
outBytestotal size (in bytes) of outbound messages.
reconnectstotal number of times the client has reconnected.

◆ natsStatistics_Destroy()

NATS_EXTERN void natsStatistics_Destroy ( natsStatistics stats)

Destroys the statistics object, freeing up memory.

Parameters
statsthe pointer to the natsStatistics object to destroy.