libpressio 0.93.0
Loading...
Searching...
No Matches
Macros | Functions
pressio_metrics.h File Reference

Metrics facilities to introspect compressor functions, input, and output. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void pressio_metrics_free (struct pressio_metrics *metrics)
 
struct pressio_optionspressio_metrics_get_results (struct pressio_metrics const *metrics)
 
struct pressio_optionspressio_metrics_get_options (struct pressio_metrics const *metrics)
 
struct pressio_optionspressio_metrics_get_configuration (struct pressio_metrics const *metrics)
 
struct pressio_optionspressio_metrics_get_documentation (struct pressio_metrics const *metrics)
 
int pressio_metrics_set_options (struct pressio_metrics const *metrics, struct pressio_options const *options)
 
struct pressio_metricspressio_metrics_clone (struct pressio_metrics *metrics)
 
void pressio_metrics_set_name (struct pressio_metrics *metrics, const char *new_name)
 
const char * pressio_metrics_get_name (struct pressio_metrics const *metrics)
 
struct pressio_optionspressio_metrics_evaluate (struct pressio_metrics *metrics, struct pressio_data const *uncompressed, struct pressio_data const *compressed, struct pressio_data const *decompressed)
 

Detailed Description

Metrics facilities to introspect compressor functions, input, and output.

Function Documentation

◆ pressio_metrics_clone()

struct pressio_metrics * pressio_metrics_clone ( struct pressio_metrics metrics)

Clones a pressio_metrics object and its configuration

Parameters
[in]metricsthe metrics object to clone
Returns
a new reference to a pressio metrics object

◆ pressio_metrics_evaluate()

struct pressio_options * pressio_metrics_evaluate ( struct pressio_metrics metrics,
struct pressio_data const *  uncompressed,
struct pressio_data const *  compressed,
struct pressio_data const *  decompressed 
)

Evaluate a metric that operates on a data buffer and return a corresponding options structure

If the metric does not support being called on data buffers, the returned object is undefined.

Parameters
[in]metricsthe metrics object to invoke
[in]uncompressedthe data before compression, if nullptr, begin/end_compress_impl will not be called
[in]compressedthe data after compression, if nullptr, the metrics object MAY choose not to compute some or all metrics, but SHOULD compute as many as possible
[in]decompressedthe data after decompression, if nullptr, begin/end_decompress_impl will not be called
Returns
a new pressio_options as if pressio_metrics_get_results was called.

◆ pressio_metrics_free()

void pressio_metrics_free ( struct pressio_metrics metrics)

frees a metrics structure

Parameters
[in]metricsthe metrics structure to free

◆ pressio_metrics_get_configuration()

struct pressio_options * pressio_metrics_get_configuration ( struct pressio_metrics const *  metrics)

Gets the configuration for a metrics structure

Parameters
[in]metricsthe metrics structure to get configuration for
Returns
a new pressio_options structure with the configuration for the metrics

◆ pressio_metrics_get_documentation()

struct pressio_options * pressio_metrics_get_documentation ( struct pressio_metrics const *  metrics)

Gets the documentation for a metrics structure

Parameters
[in]metricsthe metrics structure to get documentation for
Returns
a new pressio_options structure with the documentation for the metrics

◆ pressio_metrics_get_name()

const char * pressio_metrics_get_name ( struct pressio_metrics const *  metrics)

Get the name of a metrics

Parameters
[in]metricsthe metrics to get the name of
Returns
a string with the metrics name. The string becomes invalid if the name is set_name is called.

◆ pressio_metrics_get_options()

struct pressio_options * pressio_metrics_get_options ( struct pressio_metrics const *  metrics)

Gets the options for a metrics structure

Parameters
[in]metricsthe metrics structure to get options for
Returns
a new pressio_options structure with the options for the metrics

◆ pressio_metrics_get_results()

struct pressio_options * pressio_metrics_get_results ( struct pressio_metrics const *  metrics)

Gets the results from a metrics structure

Parameters
[in]metricsthe metrics structure to get results from
Returns
a new pressio_options structure the metrics structure to get results from

◆ pressio_metrics_set_name()

void pressio_metrics_set_name ( struct pressio_metrics metrics,
const char *  new_name 
)

Assign a new name to a metrics. Names are used to prefix options in meta-metrics.

sub-metrics will be renamed either by the of the sub-metricss prefix or by the $prefix:name configuration option

i.e. for some new_name and a metrics with prefix foo and submetricss with prefixs "abc", "def", "ghi" respectively

  • if foo:names = ['one', 'two', 'three'], then the names will be `$new_name/one, $new_name/two $new_name/three
  • otherwise the names will be $new_name/abc, $new_name/def, $new_name/ghi
Parameters
[in]metricsthe metrics to get the name of
[in]new_namethe name to set

◆ pressio_metrics_set_options()

int pressio_metrics_set_options ( struct pressio_metrics const *  metrics,
struct pressio_options const *  options 
)

Gets the options for a metrics structure

Parameters
[in]metricsthe metrics structure to get options for
[in]optionsthe to set
Returns
0 if successful, positive values on errors, negative values on warnings