![]() |
Diffusion Apple API 6.11.5
Unified Client Library for iOS, tvOS and OS X / macOS
|
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.
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.
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.
The following access control restrictions are applied:
put
or remove
a session metric collector, a session needs the CONTROL_SERVER
global permission. put
or remove
a topic metric collector, a session needs the CONTROL_SERVER
global permission. session metric collectors
or topic metric collectors
, a session needs the VIEW_SERVER
global permission. This feature may be obtained from a session
as follows:
PTDiffusionMetricsFeature *const metrics = session.metrics;
Instance Methods | |
(void) | - putSessionMetricCollector:completionHandler: |
(void) | - listSessionMetricCollectors: |
(void) | - removeSessionMetricCollector:completionHandler: |
(void) | - putTopicMetricCollector:completionHandler: |
(void) | - listTopicMetricCollectors: |
(void) | - removeTopicMetricCollector:completionHandler: |
Additional Inherited Members | |
![]() | |
PTDiffusionSession * | session |
- (void) listSessionMetricCollectors: | (void(^)(NSArray< PTDiffusionSessionMetricCollector * > *_Nullable collectors, NSError *_Nullable error)) | completionHandler |
Retrieves the current session metric collectors.
completionHandler | Block 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:
|
- (void) listTopicMetricCollectors: | (void(^)(NSArray< PTDiffusionTopicMetricCollector * > *_Nullable collectors, NSError *_Nullable error)) | completionHandler |
Retrieves the current topic metric collectors.
completionHandler | Block 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:
|
- (void) putSessionMetricCollector: | (PTDiffusionSessionMetricCollector *) | collector | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Add a session metric collector, replacing any with the same name.
collector | the session metric collector |
completionHandler | Block 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:
|
- (void) putTopicMetricCollector: | (PTDiffusionTopicMetricCollector *) | collector | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Add a topic metric collector, replacing any with the same name.
PTDiffusionTopicMetricCollector
instance can be created using PTDiffusionTopicMetricCollectorBuilder
.
collector | the topic metric collector |
completionHandler | Block 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:
|
- (void) removeSessionMetricCollector: | (NSString *) | name | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Removes any session metric collector with the given name, if it exists.
name | the session metric collector name |
completionHandler | Block 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:
|
- (void) removeTopicMetricCollector: | (NSString *) | name | |
completionHandler: | (void(^)(NSError *_Nullable error)) | completionHandler | |
Removes any topic metric collector with the given name, if it exists.
name | the topic metric collector name |
completionHandler | Block 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:
|