Diffusion C API  6.8.0
 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_maximum_groups (DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T *builder, int limit)
 Set the maximum number of groups maintained by the metric collector. 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_maximum_groups (DIFFUSION_SESSION_METRIC_COLLECTOR_T *collector, int *maximum_groups)
 Limit the number of groups maintained by this metric collector. 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_maximum_groups (DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder, int limit)
 Set the maximum number of groups maintained by the metric collector. 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_BUILDER_Tdiffusion_topic_metric_collector_builder_group_by_path_prefix_parts (DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder, int parts)
 Specifies the number of leading parts of the topic path the metric collector should use to group results. More...
 
 DEPRECATED (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *diffusion_topic_metric_collector_builder_create_collector(DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder, char *name, char *topic_selector)) DIFFUSION_TOPIC_METRIC_COLLECTOR_T *diffusion_topic_metric_collector_builder_create(DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T *builder
 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_group_by_path_prefix_parts (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector, int *group_by_path_prefix_parts)
 Specifies the number of leading parts of the topic path to group by, or 0, if the collector does not group by path prefix. 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_maximum_groups (DIFFUSION_TOPIC_METRIC_COLLECTOR_T *collector, int *maximum_groups)
 Limit the number of groups maintained by this metric collector. 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

DEPRECATED ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T diffusion_topic_metric_collector_builder_create_collectorDIFFUSION_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
a new topic metric collector if the operation was successful, NULL otherwise.
Since
6.7
Deprecated:
since 6.8 and will be removed in a future release use diffusion_topic_metric_collector_builder_create instead

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
api_errorpopulated on API error. Can be NULL.
Returns
a new topic metric collector if the operation was successful, NULL 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.
Since
6.7
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.

Limit the number of groups maintained by this metric collector.

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
Since
6.7

Session metric collectors can group metrics by properties. This property places an upper limit on the number of groups that will be maintained for the metric collector.

For example, if a session metric collector groups by $SessionId and maximum_groups is 10, then metrics will only be collected for the first 10 sessions.

Parameters
builderthe session metric collector builder
matrue to export metrics to Prometheus
Returns
the session metric collector builder
Since
6.7
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
Since
6.7
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
Since
6.7
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
Since
6.7
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
Since
6.7
DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T* diffusion_session_metric_collector_builder_maximum_groups ( DIFFUSION_SESSION_METRIC_COLLECTOR_BUILDER_T builder,
int  limit 
)

Set the maximum number of groups maintained by the metric collector.

By default, the number of groups is not limited.

Parameters
builderthe session metric collector builder
limita positive integer
Returns
the session metric collector builder
Since
6.8
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
Since
6.7
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
Since
6.7
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.
Since
6.7
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
Since
6.7
void diffusion_session_metric_collector_free ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector)

Free a session metric collector.

Parameters
collectorthe session metric collector
Since
6.7
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
Since
6.7
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
Since
6.7
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
Since
6.7
bool diffusion_session_metric_collector_maximum_groups ( DIFFUSION_SESSION_METRIC_COLLECTOR_T collector,
int *  maximum_groups 
)

Limit the number of groups maintained by this metric collector.

Session metric collectors can group metrics by properties. This property places an upper limit on the number of groups that will be maintained for the metric collector.

For example, if a session metric collector groups by $SessionId and maximum_groups is 10, then metrics will only be collected for the first 10 sessions.

Parameters
collectorthe session metric collector
exportsthe variable that will receive the int value if present
Returns
true if the collector is valid and extracted the value
Since
6.8
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
Since
6.7
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
Since
6.7
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
Since
6.7
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T* diffusion_topic_metric_collector_builder_group_by_path_prefix_parts ( DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T builder,
int  parts 
)

Specifies the number of leading parts of the topic path the metric collector should use to group results.

By default a topic metric collector does not group by the topic path prefix. If a positive number of parts is specified, it will enable grouping.

Parameters
builderthe topic metric collector builder
partsthe number of leading parts of the topic path to group by; set to 0 to disable grouping by path
Returns
the topic metric collector builder
Since
6.8
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
Since
6.7
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
Since
6.7
DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T* diffusion_topic_metric_collector_builder_maximum_groups ( DIFFUSION_TOPIC_METRIC_COLLECTOR_BUILDER_T builder,
int  limit 
)

Set the maximum number of groups maintained by the metric collector.

By default, the number of groups is not limited.

Parameters
builderthe session metric collector builder
limita positive integer
Returns
the topic metric collector builder
Since
6.8
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
Since
6.7
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.
Since
6.7
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
Since
6.7
void diffusion_topic_metric_collector_free ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector)

Free a topic metric collector.

Parameters
collectorthe topic metric collector
Since
6.7
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
Since
6.7
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
Since
6.7
bool diffusion_topic_metric_collector_group_by_path_prefix_parts ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector,
int *  group_by_path_prefix_parts 
)

Specifies the number of leading parts of the topic path to group by, or 0, if the collector does not group by path prefix.

Parameters
collectorthe topic metric collector
group_by_path_prefix_partsthe variable that will receive the int value if present
Returns
true if the collector is valid and extracted the value
Since
6.8
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
Since
6.7
bool diffusion_topic_metric_collector_maximum_groups ( DIFFUSION_TOPIC_METRIC_COLLECTOR_T collector,
int *  maximum_groups 
)

Limit the number of groups maintained by this metric collector.

Topic metric collectors can group metrics by properties. This property places an upper limit on the number of groups that will be maintained for the metric collector.

Parameters
collectorthe topic metric collector
exportsthe variable that will receive the int value if present
Returns
true if the collector is valid and extracted the value
Since
6.8