Loading...
Searching...
No Matches
Statistics
Functions

## Functions

NATS_EXTERN natsStatus | natsStatistics_Create (natsStatistics **newStats)
| Creates a natsStatistics object.
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.
NATS_EXTERN void | natsStatistics_Destroy (natsStatistics *stats)
| Destroys the natsStatistics object.

## 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

  newStats | the 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

  stats | the pointer to the natsStatistics object to get the values from.
  inMsgs | total number of inbound messages.
  inBytes | total size (in bytes) of inbound messages.
  outMsgs | total number of outbound messages.
  outBytes | total size (in bytes) of outbound messages.
  reconnects | total number of times the client has reconnected.

## natsStatistics_Destroy()

NATS_EXTERN void natsStatistics_Destroy | ( | natsStatistics * | stats | ) |

Destroys the statistics object, freeing up memory.

Parameters

  stats | the pointer to the natsStatistics object to destroy.