Diffusion Apple API  6.9.0
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Files Functions Variables Enumerations Enumerator Properties Pages
Instance Methods | List of all members
PTDiffusionMetricsFeature Class Reference

Introduction

This feature allows a client to configure metric collectors.

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

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:

Accessing the feature

This feature may be obtained from a session as follows:

   PTDiffusionMetricsFeature *const metrics = session.metrics;
 
Author
Push Technology Limited
Since
6.7
Inheritance diagram for PTDiffusionMetricsFeature:
PTDiffusionFeature

Instance Methods

(void) - putSessionMetricCollector:completionHandler:
 
(void) - listSessionMetricCollectors:
 
(void) - removeSessionMetricCollector:completionHandler:
 
(void) - putTopicMetricCollector:completionHandler:
 
(void) - listTopicMetricCollectors:
 
(void) - removeTopicMetricCollector:completionHandler:
 

Additional Inherited Members

- Properties inherited from PTDiffusionFeature
PTDiffusionSessionsession
 

Method Documentation

- (void) listSessionMetricCollectors: (NSArray< PTDiffusionSessionMetricCollector * > *_Nullable)  collectors
(NSError *_Nullable error)  completionHandler 

Retrieves the current session metric collectors.

Parameters
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil and the collectors will not be nil. The completion handler will be called asynchronously on the main dispatch queue. These are the common reasons for failure:
  • PTDiffusionError_AccessDenied if the calling session does not have the VIEW_SERVER permission;
  • PTDiffusionError_SessionClosed if the session is closed.
Since
6.7
- (void) listTopicMetricCollectors: (NSArray< PTDiffusionTopicMetricCollector * > *_Nullable)  collectors
(NSError *_Nullable error)  completionHandler 

Retrieves the current topic metric collectors.

Parameters
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil and the collectors will not be nil. The completion handler will be called asynchronously on the main dispatch queue. These are the common reasons for failure:
  • PTDiffusionError_AccessDenied if the calling session does not have the VIEW_SERVER permission;
  • PTDiffusionError_SessionClosed if the session is closed.
Since
6.7
- (void) putSessionMetricCollector: (PTDiffusionSessionMetricCollector *)  collector
completionHandler: (NSError *_Nullable error)  completionHandler 

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

Parameters
collectorthe session metric collector
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil. The completion handler will be called asynchronously on the main dispatch queue. These are the common reasons for failure:
  • PTDiffusionError_InvalidFilter if the metric collector session filter is invalid;
  • PTDiffusionError_AccessDenied if the calling session does not have the CONTROL_SERVER permission;
  • PTDiffusionError_ClusterRouting if the operation failed due to a transient cluster error;
  • PTDiffusionError_SessionClosed if the session is closed.
Since
6.7
- (void) putTopicMetricCollector: (PTDiffusionTopicMetricCollector *)  collector
completionHandler: (NSError *_Nullable error)  completionHandler 

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

PTDiffusionTopicMetricCollector instance can be created using PTDiffusionTopicMetricCollectorBuilder.

Parameters
collectorthe topic metric collector
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil. The completion handler will be called asynchronously on the main dispatch queue. These are the common reasons for failure:
  • PTDiffusionError_AccessDenied if the calling session does not have the CONTROL_SERVER permission;
  • PTDiffusionError_ClusterRouting if the operation failed due to a transient cluster error;
  • PTDiffusionError_SessionClosed if the session is closed.
Since
6.7
- (void) removeSessionMetricCollector: (NSString *)  name
completionHandler: (NSError *_Nullable error)  completionHandler 

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

Parameters
namethe session metric collector name
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil. The completion handler will be called asynchronously on the main dispatch queue. These are the common reasons for failure:
  • PTDiffusionError_AccessDenied if the calling session does not have the CONTROL_SERVER permission;
  • PTDiffusionError_ClusterRouting if the operation failed due to a transient cluster error;
  • PTDiffusionError_SessionClosed if the session is closed.
Since
6.7
- (void) removeTopicMetricCollector: (NSString *)  name
completionHandler: (NSError *_Nullable error)  completionHandler 

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

Parameters
namethe topic metric collector name
completionHandlerBlock to be called asynchronously on success or failure. If the operation was successful, the error argument passed to the block will be nil. The completion handler will be called asynchronously on the main dispatch queue. These are the common reasons for failure:
  • PTDiffusionError_AccessDenied if the calling session does not have the CONTROL_SERVER permission;
  • PTDiffusionError_ClusterRouting if the operation failed due to a transient cluster error;
  • PTDiffusionError_SessionClosed if the session is closed.
Since
6.7