Diffusion C API  6.7.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
metrics.h File Reference

Metrics feature. More...

Data Structures

struct  diffusion_metrics_put_session_metric_collector_params_s
 Structure supplied when issuing a diffusion_metrics_put_session_metric_collector call. More...
 
struct  diffusion_metrics_put_topic_metric_collector_params_s
 Structure supplied when issuing a diffusion_metrics_put_topic_metric_collector call. More...
 
struct  diffusion_metrics_remove_session_metric_collector_params_s
 Structure supplied when issuing a diffusion_metrics_remove_session_metric_collector call. More...
 
struct  diffusion_metrics_remove_topic_metric_collector_params_s
 Structure supplied when issuing a diffusion_metrics_remove_topic_metric_collector call. More...
 
struct  diffusion_metrics_list_session_metric_collectors_params_s
 Structure supplied when issuing a diffusion_metrics_list_session_metric_collectors call. More...
 
struct  diffusion_metrics_list_topic_metric_collectors_params_s
 Structure supplied when issuing a diffusion_metrics_list_topic_metric_collectors call. More...
 

Typedefs

typedef struct
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T 
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T
 Opaque Session Metric Collector Builder struct.
 
typedef struct
DIFFUSION_SESSION_METRIC_COLLECTOR_T 
DIFFUSION_SESSION_METRIC_COLLECTOR_T
 Opaque Session Metric Collector struct.
 
typedef struct
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T 
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T
 Opaque Topic Metric Collector Builder struct.
 
typedef struct
DIFFUSION_TOPIC_METRIC_COLLECTOR_T 
DIFFUSION_TOPIC_METRIC_COLLECTOR_T
 Opaque Topic Metric Collector struct.
 
typedef int(* session_metric_collector_put_cb )(void *context)
 callback when a session metric collector has been set on the server. More...
 
typedef int(* session_metric_collector_remove_cb )(void *context)
 callback when a session metric collector has been removed from the server. More...
 
typedef int(* session_metric_collector_list_cb )(const LIST_T *session_metric_collectors, void *context)
 callback when the list of session metric collectors has been retrieved from the server. More...
 
typedef int(* topic_metric_collector_put_cb )(void *context)
 callback when a topic metric collector has been set on the server. More...
 
typedef int(* topic_metric_collector_remove_cb )(void *context)
 callback when a topic metric collector has been removed from the server. More...
 
typedef int(* topic_metric_collector_list_cb )(const LIST_T *topic_metric_collectors, void *context)
 callback when the list of topic metric collectors has been retrieved from the server. More...
 
typedef struct
diffusion_metrics_put_session_metric_collector_params_s 
DIFFUSION_METRICS_PUT_SESSION_METRIC_COLLECTOR_PARAMS_T
 Structure supplied when issuing a diffusion_metrics_put_session_metric_collector call.
 
typedef struct
diffusion_metrics_put_topic_metric_collector_params_s 
DIFFUSION_METRICS_PUT_TOPIC_METRIC_COLLECTOR_PARAMS_T
 Structure supplied when issuing a diffusion_metrics_put_topic_metric_collector call.
 
typedef struct
diffusion_metrics_remove_session_metric_collector_params_s 
DIFFUSION_METRICS_REMOVE_SESSION_METRIC_COLLECTOR_PARAMS_T
 Structure supplied when issuing a diffusion_metrics_remove_session_metric_collector call.
 
typedef struct
diffusion_metrics_remove_topic_metric_collector_params_s 
DIFFUSION_METRICS_REMOVE_TOPIC_METRIC_COLLECTOR_PARAMS_T
 Structure supplied when issuing a diffusion_metrics_remove_topic_metric_collector call.
 
typedef struct
diffusion_metrics_list_session_metric_collectors_params_s 
DIFFUSION_METRICS_LIST_SESSION_METRIC_COLLECTORS_PARAMS_T
 Structure supplied when issuing a diffusion_metrics_list_session_metric_collectors call.
 
typedef struct
diffusion_metrics_list_topic_metric_collectors_params_s 
DIFFUSION_METRICS_LIST_TOPIC_METRIC_COLLECTORS_PARAMS_T
 Structure supplied when issuing a diffusion_metrics_list_topic_metric_collectors call.
 

Functions

DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_Tdiffusion_session_metric_collector_builder_init ()
 Initialize a new session metric collector builder. More...
 
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_Tdiffusion_session_metric_collector_builder_reset (DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T *builder)
 Reset the session metric collector builder's internal values. More...
 
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_Tdiffusion_session_metric_collector_builder_export_to_prometheus (DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T *builder, bool export)
 Specifies whether the metric collector should export metrics to Prometheus or not. More...
 
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_Tdiffusion_session_metric_collector_builder_group_by_property (DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T *builder, char *property_name)
 Adds the name of a session property to group by to the list known to this builder. More...
 
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_Tdiffusion_session_metric_collector_builder_group_by_properties (DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T *builder, LIST_T *property_names)
 Specifies a list of session property names to group by, replacing any current list known to this builder. More...
 
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_Tdiffusion_session_metric_collector_builder_remove_metrics_with_no_matches (DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T *builder, bool remove)
 Specifies whether the metric collector should remove any metrics that have no matches. More...
 
void diffusion_session_metric_collector_builder_free (DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T *builder)
 Free a session metric collector builder. More...
 
void diffusion_session_metric_collector_free (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector)
 Free a session metric collector. More...
 
bool diffusion_session_metric_collector_get_session_filter (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector, char **session_filter)
 Returns the session filter of the session metric collector. More...
 
bool diffusion_session_metric_collector_get_name (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector, char **name)
 Returns the name of the session metric collector. More...
 
bool diffusion_session_metric_collector_removes_metrics_with_no_matches (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector, bool *removes)
 Indicates whether metrics with no matches should be removed. More...
 
bool diffusion_session_metric_collector_exports_to_prometheus (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector, bool *exports)
 Indicates whether the metric collector exports to Prometheus. More...
 
bool diffusion_session_metric_collector_get_group_by_properties (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector, LIST_T **group_by)
 Returns the list of properties to group by. More...
 
bool diffusion_session_metric_collector_compare (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector_1, DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector_2)
 Compares two session metric collectors. More...
 
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_Tdiffusion_topic_metric_collector_builder_init ()
 Initialize a new topic metric collector builder. More...
 
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_Tdiffusion_topic_metric_collector_builder_reset (DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder)
 Reset the topic metric collector builder's internal values. More...
 
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_Tdiffusion_topic_metric_collector_builder_export_to_prometheus (DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder, bool export)
 Specifies whether the metric collector should export metrics to Prometheus or not. More...
 
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_Tdiffusion_topic_metric_collector_builder_group_by_topic_type (DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder, bool group_by_topic_type)
 Specifies whether the metric collector should group by topic type. More...
 
DIFFUSION_TOPIC_METRIC_COLLECTOR_Tdiffusion_topic_metric_collector_builder_create_collector (DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder, char *name, char *topic_selector)
 Create a new topic metric collector using the values currently known by the builder. More...
 
void diffusion_topic_metric_collector_builder_free (DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder)
 Free a topic metric collector builder. More...
 
void diffusion_topic_metric_collector_free (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector)
 Free a topic metric collector. More...
 
bool diffusion_topic_metric_collector_get_topic_selector (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector, char **topic_selector)
 Returns the topic selector of the topic metric collector. More...
 
bool diffusion_topic_metric_collector_get_name (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector, char **name)
 Returns the name of the topic metric collector. More...
 
bool diffusion_topic_metric_collector_groups_by_topic_type (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector, bool *groups_by_topic_type)
 Specifies whether the metric collector should group by topic type. More...
 
bool diffusion_topic_metric_collector_exports_to_prometheus (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector, bool *exports)
 Indicates whether the metric collector exports to Prometheus. More...
 
bool diffusion_topic_metric_collector_compare (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector_1, DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector_2)
 Compares two topic metric collectors. More...
 
bool diffusion_metrics_put_session_metric_collector (SESSION_T *session, const DIFFUSION_METRICS_PUT_SESSION_METRIC_COLLECTOR_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Add a session metric collector, replacing any with the same name. More...
 
bool diffusion_metrics_list_session_metric_collectors (SESSION_T *session, const DIFFUSION_METRICS_LIST_SESSION_METRIC_COLLECTORS_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Retrieves the current session metric collectors. More...
 
bool diffusion_metrics_remove_session_metric_collector (SESSION_T *session, const DIFFUSION_METRICS_REMOVE_SESSION_METRIC_COLLECTOR_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Removes any session metric collector with the given name, if it exists. More...
 
bool diffusion_metrics_put_topic_metric_collector (SESSION_T *session, const DIFFUSION_METRICS_PUT_TOPIC_METRIC_COLLECTOR_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Add a topic metric collector, replacing any with the same name. More...
 
bool diffusion_metrics_list_topic_metric_collectors (SESSION_T *session, const DIFFUSION_METRICS_LIST_TOPIC_METRIC_COLLECTORS_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Retrieves the current topic metric collectors. More...
 
bool diffusion_metrics_remove_topic_metric_collector (SESSION_T *session, const DIFFUSION_METRICS_REMOVE_TOPIC_METRIC_COLLECTOR_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Removes any topic metric collector with the given name, if it exists. More...
 

Detailed Description

Metrics feature.

This feature allows a client to configure metric collectors.

Diffusion servers provide metrics which are made available in several ways:-

  • Java Management Extensions (JMX) MBeans.
  • Through the Diffusion Management Console.
  • As endpoints for Prometheus.

Metric collectors allow custom aggregation of metrics that are relevant to your application. There are no default metric collectors, only the ones that you create.

There are two types of metric collector: Session Metric Collectors and Topic Metric Collectors.

For full details regarding the configuration and operation of metric collectors see the user manual.

Session Metric Collectors

These can be configured to record metric data for a subset of all sessions, specified with a session filter.

The set of metrics recorded by each session metric collector is the same as those recorded for the whole server. For full details of session metrics, see the table in the user manual.

If the session filters of two different session metric collectors select the same session, both will record metrics for that session. It is only valid to add the metrics of different session metric collectors if their session filters select distinct sets of sessions.

You can optionally group the sessions within a collector by session properties.

Topic Metric Collectors

These can be configured to record metric data for a subset of all topics, specified with a topic selector.

You can optionally group the topics within a collector by topic type.

The set of metrics recorded by each topic metric collector is the same as those recorded for the whole server. For full details of topic metrics, see the table in the user manual.

If the topic selectors of two different topic metric collectors select the same topic, both will record metrics for that topic. It is only valid to add the metrics of different topic metric collectors if their topic selectors select distinct sets of topics.

Access control

The following access control restrictions are applied:

Since
6.7

Typedef Documentation

typedef int(* session_metric_collector_list_cb)(const LIST_T *session_metric_collectors, void *context)

callback when the list of session metric collectors has been retrieved from the server.

Parameters
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* session_metric_collector_put_cb)(void *context)

callback when a session metric collector has been set on the server.

Parameters
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* session_metric_collector_remove_cb)(void *context)

callback when a session metric collector has been removed from the server.

Parameters
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* topic_metric_collector_list_cb)(const LIST_T *topic_metric_collectors, void *context)

callback when the list of topic metric collectors has been retrieved from the server.

Parameters
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* topic_metric_collector_put_cb)(void *context)

callback when a topic metric collector has been set on the server.

Parameters
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* topic_metric_collector_remove_cb)(void *context)

callback when a topic metric collector has been removed from the server.

Parameters
contextUser supplied context.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.

Function Documentation

bool diffusion_metrics_list_session_metric_collectors ( SESSION_T session,
const DIFFUSION_METRICS_LIST_SESSION_METRIC_COLLECTORS_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Retrieves the current session metric collectors.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsParameter structure describing the callbacks to be invoked.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful. False, otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
bool diffusion_metrics_list_topic_metric_collectors ( SESSION_T session,
const DIFFUSION_METRICS_LIST_TOPIC_METRIC_COLLECTORS_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Retrieves the current topic metric collectors.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsParameter structure describing the callbacks to be invoked.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful. False, otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
bool diffusion_metrics_put_session_metric_collector ( SESSION_T session,
const DIFFUSION_METRICS_PUT_SESSION_METRIC_COLLECTOR_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Add a session metric collector, replacing any with the same name.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsParameter structure describing the session metric collector and the callbacks to be invoked.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful. False, otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
bool diffusion_metrics_put_topic_metric_collector ( SESSION_T session,
const DIFFUSION_METRICS_PUT_TOPIC_METRIC_COLLECTOR_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Add a topic metric collector, replacing any with the same name.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsParameter structure describing the topic metric collector and the callbacks to be invoked.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful. False, otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
bool diffusion_metrics_remove_session_metric_collector ( SESSION_T session,
const DIFFUSION_METRICS_REMOVE_SESSION_METRIC_COLLECTOR_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Removes any session metric collector with the given name, if it exists.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsParameter structure describing the session metric collector name and the callbacks to be invoked.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful. False, otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
bool diffusion_metrics_remove_topic_metric_collector ( SESSION_T session,
const DIFFUSION_METRICS_REMOVE_TOPIC_METRIC_COLLECTOR_PARAMS_T  params,
DIFFUSION_API_ERROR api_error 
)

Removes any topic metric collector with the given name, if it exists.

Parameters
sessionThe current session. If NULL, this function returns immediately.
paramsParameter structure describing the topic metric collector name and the callbacks to be invoked.
api_errorPopulated on API error. Can be NULL.
Returns
true if the operation was successful. False, otherwise. In this case, if a non-NULL api_error pointer has been provided, this will be populated with the error information and should be freed with diffusion_api_error_free.
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T* diffusion_session_metric_collector_builder_export_to_prometheus ( DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T builder,
bool  export 
)

Specifies whether the metric collector should export metrics to Prometheus or not.

The default is that metrics are not exported to Prometheus.

Parameters
builderthe session metric collector builder
exporttrue to export metrics to Prometheus
Returns
the session metric collector builder
void diffusion_session_metric_collector_builder_free ( DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T builder)

Free a session metric collector builder.

Parameters
builderthe session metric collector builder
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T* diffusion_session_metric_collector_builder_group_by_properties ( DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T builder,
LIST_T property_names 
)

Specifies a list of session property names to group by, replacing any current list known to this builder.

Parameters
builderthe session metric collector builder
property_namesa list of session property names. See session.h for details of session properties
Returns
the session metric collector builder
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T* diffusion_session_metric_collector_builder_group_by_property ( DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T builder,
char *  property_name 
)

Adds the name of a session property to group by to the list known to this builder.

By default a builder will initially have no session properties to group by set.

Parameters
builderthe session metric collector builder
property_namethe name of the session property. See session.h for details of session properties
Returns
the session metric collector builder
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T* diffusion_session_metric_collector_builder_init ( )

Initialize a new session metric collector builder.

diffusion_session_metric_collector_builder_free should be called on this pointer when no longer needed.

Returns
the session metric collector builder
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T* diffusion_session_metric_collector_builder_remove_metrics_with_no_matches ( DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T builder,
bool  remove 
)

Specifies whether the metric collector should remove any metrics that have no matches.

The default is that the metric collector will not remove metrics with no matches.

Parameters
builderthe session metric collector builder
removetrue to indicate that metrics with no matches should be removed
Returns
the session metric collector builder
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T* diffusion_session_metric_collector_builder_reset ( DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T builder)

Reset the session metric collector builder's internal values.

Parameters
builderthe session metric collector builder
Returns
the session metric collector builder
bool diffusion_session_metric_collector_compare ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector_1,
DIFFUSION_SESSION_METRIC_COLLECTOR_T collector_2 
)

Compares two session metric collectors.

Parameters
collector_1a session metric collector
collector_2another session metric collector
Returns
true if both session metric collectors are identical.
bool diffusion_session_metric_collector_exports_to_prometheus ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector,
bool *  exports 
)

Indicates whether the metric collector exports to Prometheus.

Parameters
collectorthe session metric collector
exportsthe variable that will receive the bool value if present
Returns
true if the collector is valid and extracted the value
void diffusion_session_metric_collector_free ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector)

Free a session metric collector.

Parameters
collectorthe session metric collector
bool diffusion_session_metric_collector_get_group_by_properties ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector,
LIST_T **  group_by 
)

Returns the list of properties to group by.

Parameters
collectorthe session metric collector
group_bythe variable that will receive the list value if present
Returns
true if the collector is valid and extracted the value
bool diffusion_session_metric_collector_get_name ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector,
char **  name 
)

Returns the name of the session metric collector.

Parameters
collectorthe session metric collector
namethe variable that will receive the name if present
Returns
true if the collector is valid and extracted the value
bool diffusion_session_metric_collector_get_session_filter ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector,
char **  session_filter 
)

Returns the session filter of the session metric collector.

Parameters
collectorthe session metric collector
session_filterthe variable that will receive the session filter if present
Returns
true if the collector is valid and extracted the value
bool diffusion_session_metric_collector_removes_metrics_with_no_matches ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector,
bool *  removes 
)

Indicates whether metrics with no matches should be removed.

Parameters
collectorthe session metric collector
removesthe variable that will receive the bool value if present
Returns
true if the collector is valid and extracted the value
DIFFUSION_TOPIC_METRIC_COLLECTOR_T* diffusion_topic_metric_collector_builder_create_collector ( DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T builder,
char *  name,
char *  topic_selector 
)

Create a new topic metric collector using the values currently known by the builder.

Parameters
builderthe topic metric collector builder
namethe name of the topic metric collector
topic_selectorthe selector pattern that specifies the topics for which metrics are to be collected
Returns
the topic metric collector
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T* diffusion_topic_metric_collector_builder_export_to_prometheus ( DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T builder,
bool  export 
)

Specifies whether the metric collector should export metrics to Prometheus or not.

The default is that metrics are not exported to Prometheus.

Parameters
builderthe topic metric collector builder
exporttrue to export metrics to Prometheus
Returns
the topic metric collector builder
void diffusion_topic_metric_collector_builder_free ( DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T builder)

Free a topic metric collector builder.

Parameters
builderthe topic metric collector builder
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T* diffusion_topic_metric_collector_builder_group_by_topic_type ( DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T builder,
bool  group_by_topic_type 
)

Specifies whether the metric collector should group by topic type.

By default a topic metric collector does not group by topic type.

Parameters
builderthe topic metric collector builder
group_by_topic_typetrue to indicate that the collector should group by topic type
Returns
the topic metric collector builder
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T* diffusion_topic_metric_collector_builder_init ( )

Initialize a new topic metric collector builder.

diffusion_session_topic_collector_builder_free should be called on this pointer when no longer needed.

Returns
the topic metric collector builder
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T* diffusion_topic_metric_collector_builder_reset ( DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T builder)

Reset the topic metric collector builder's internal values.

Parameters
builderthe topic metric collector builder
Returns
the topic metric collector builder
bool diffusion_topic_metric_collector_compare ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector_1,
DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector_2 
)

Compares two topic metric collectors.

Parameters
collector_1a topic metric collector
collector_2another topic metric collector
Returns
true if both topic metric collectors are identical.
bool diffusion_topic_metric_collector_exports_to_prometheus ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector,
bool *  exports 
)

Indicates whether the metric collector exports to Prometheus.

Parameters
collectorthe topic metric collector
exportsthe variable that will receive the bool value if present
Returns
true if the collector is valid and extracted the value
void diffusion_topic_metric_collector_free ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector)

Free a topic metric collector.

Parameters
collectorthe topic metric collector
bool diffusion_topic_metric_collector_get_name ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector,
char **  name 
)

Returns the name of the topic metric collector.

Parameters
collectorthe topic metric collector
namethe variable that will receive the name if present
Returns
true if the collector is valid and extracted the value
bool diffusion_topic_metric_collector_get_topic_selector ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector,
char **  topic_selector 
)

Returns the topic selector of the topic metric collector.

Parameters
collectorthe topic metric collector
topic_selectorthe variable that will receive the topic selector if present
Returns
true if the collector is valid and extracted the value
bool diffusion_topic_metric_collector_groups_by_topic_type ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector,
bool *  groups_by_topic_type 
)

Specifies whether the metric collector should group by topic type.

Parameters
collectorthe topic metric collector
groups_by_topic_typethe variable that will receive the bool value if present
Returns
true if the collector is valid and extracted the value