Function TRITONSERVER_MetricsFormatted

Function Documentation

TRITONSERVER_Error *TRITONSERVER_MetricsFormatted(TRITONSERVER_Metrics *metrics, TRITONSERVER_MetricFormat format, const char **base, size_t *byte_size)

Get a buffer containing the metrics in the specified format.

For each format the buffer contains the following:

TRITONSERVER_METRIC_PROMETHEUS: ‘base’ points to a single multiline string (char*) that gives a text representation of the metrics in prometheus format. ‘byte_size’ returns the length of the string in bytes.

The buffer is owned by the ‘metrics’ object and should not be modified or freed by the caller. The lifetime of the buffer extends only as long as ‘metrics’ and must not be accessed once ‘metrics’ is deleted.

Return

a TRITONSERVER_Error indicating success or failure.

Parameters
  • metrics: The metrics object.

  • format: The format to use for the returned metrics.

  • base: Returns a pointer to the base of the formatted metrics, as described above.

  • byte_size: Returns the size, in bytes, of the formatted metrics.