Get Current Metric Data
| connect_get_current_metric_data | R Documentation |
Gets the real-time metric data from the specified Connect Customer instance¶
Description¶
Gets the real-time metric data from the specified Connect Customer instance.
For a description of each metric, see Metrics definitions in the Connect Customer Administrator Guide.
When you make a successful API request, you can expect the following metric values in the response:
-
Metric value is null: The calculation cannot be performed due to divide by zero or insufficient data
-
Metric value is a number (including 0) of defined type: The number provided is the calculation result
-
MetricResult list is empty: The request cannot find any data in the system
The following guidelines can help you work with the API:
-
Each dimension in the metric response must contain a value
-
Each item in MetricResult must include all requested metrics
-
If the response is slow due to large result sets, try these approaches:
-
Add filters to reduce the amount of data returned
Usage¶
connect_get_current_metric_data(InstanceId, Filters, Groupings,
CurrentMetrics, NextToken, MaxResults, SortCriteria)
Arguments¶
InstanceId |
[required] The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance. |
Filters |
[required] The filters to apply to returned metrics. You can filter up to the following limits:
Metric data is retrieved only for the resources associated with the queues or routing profiles, and by any channels included in the filter. (You cannot filter by both queue AND routing profile.) You can include both resource IDs and resource ARNs in the same request. When using When using When using When using the Currently tagging is only supported on the resources that are passed in the filter. |
Groupings |
Defines the level of aggregation for metrics data by a
dimension(s). Its similar to sorting items into buckets based on a
common characteristic, then counting or calculating something for each
bucket. For example, when grouped by The grouping list is an ordered list, with the first item in the list defined as the primary grouping. If no grouping is included in the request, the aggregation happens at the instance-level.
|
CurrentMetrics |
[required] The metrics to retrieve. Specify the name or metricId, and unit for each metric. The following metrics are available. For a description of all the metrics, see Metrics definitions in the Connect Customer Administrator Guide. MetricId should be used to reference custom metrics or out of the box metrics as Arn. If using MetricId, the limit is 10 MetricId per request. AGENTS_AFTER_CONTACT_WORK Unit: COUNT Name in real-time metrics report: ACW AGENTS_AVAILABLE Unit: COUNT Name in real-time metrics report: Available AGENTS_ERROR Unit: COUNT Name in real-time metrics report: Error AGENTS_NON_PRODUCTIVE Unit: COUNT Name in real-time metrics report: NPT (Non-Productive Time) AGENTS_ON_CALL Unit: COUNT Name in real-time metrics report: On contact AGENTS_ON_CONTACT Unit: COUNT Name in real-time metrics report: On contact AGENTS_ONLINE Unit: COUNT Name in real-time metrics report: Online AGENTS_STAFFED Unit: COUNT Name in real-time metrics report: Staffed CONTACTS_IN_QUEUE Unit: COUNT Name in real-time metrics report: In queue CONTACTS_SCHEDULED Unit: COUNT Name in real-time metrics report: Scheduled ESTIMATED_WAIT_TIME Unit: SECONDS This metric supports filter and grouping combination only used for core routing purpose. Valid filter and grouping use cases:
OLDEST_CONTACT_AGE Unit: SECONDS When you use groupings, Unit says SECONDS and the Value is returned in SECONDS. When you do not use groupings, Unit says SECONDS but the Value is returned in MILLISECONDS. For example, if you get a response like this:
The actual OLDEST_CONTACT_AGE is 24 seconds. When the filter Name in real-time metrics report: Oldest SLOTS_ACTIVE Unit: COUNT Name in real-time metrics report: Active SLOTS_AVAILABLE Unit: COUNT Name in real-time metrics report: Availability |
NextToken |
The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. The token expires after 5 minutes from the time it is created. Subsequent requests that use the token must use the same request parameters as the request that generated the token. |
MaxResults |
The maximum number of results to return per page. |
SortCriteria |
The way to sort the resulting response based on metrics. You can
enter one sort criteria. By default resources are sorted based on
Note the following:
|
Value¶
A list with the following syntax:
list(
NextToken = "string",
MetricResults = list(
list(
Dimensions = list(
Queue = list(
Id = "string",
Arn = "string"
),
Channel = "VOICE"|"CHAT"|"TASK"|"EMAIL",
RoutingProfile = list(
Id = "string",
Arn = "string"
),
RoutingStepExpression = "string",
AgentStatus = list(
Arn = "string",
Id = "string"
),
Subtype = "string",
ValidationTestType = "string"
),
Collections = list(
list(
Metric = list(
Name = "AGENTS_ONLINE"|"AGENTS_AVAILABLE"|"AGENTS_ON_CALL"|"AGENTS_NON_PRODUCTIVE"|"AGENTS_AFTER_CONTACT_WORK"|"AGENTS_ERROR"|"AGENTS_STAFFED"|"CONTACTS_IN_QUEUE"|"OLDEST_CONTACT_AGE"|"CONTACTS_SCHEDULED"|"AGENTS_ON_CONTACT"|"SLOTS_ACTIVE"|"SLOTS_AVAILABLE"|"ESTIMATED_WAIT_TIME",
MetricId = "string",
Unit = "SECONDS"|"COUNT"|"PERCENT"
),
Value = 123.0
)
)
)
),
DataSnapshotTime = as.POSIXct(
"2015-01-01"
),
ApproximateTotalCount = 123
)
Request syntax¶
svc$get_current_metric_data(
InstanceId = "string",
Filters = list(
Queues = list(
"string"
),
Channels = list(
"VOICE"|"CHAT"|"TASK"|"EMAIL"
),
RoutingProfiles = list(
"string"
),
RoutingStepExpressions = list(
"string"
),
AgentStatuses = list(
"string"
),
Subtypes = list(
"string"
),
ValidationTestTypes = list(
"string"
)
),
Groupings = list(
"QUEUE"|"CHANNEL"|"ROUTING_PROFILE"|"ROUTING_STEP_EXPRESSION"|"AGENT_STATUS"|"SUBTYPE"|"VALIDATION_TEST_TYPE"
),
CurrentMetrics = list(
list(
Name = "AGENTS_ONLINE"|"AGENTS_AVAILABLE"|"AGENTS_ON_CALL"|"AGENTS_NON_PRODUCTIVE"|"AGENTS_AFTER_CONTACT_WORK"|"AGENTS_ERROR"|"AGENTS_STAFFED"|"CONTACTS_IN_QUEUE"|"OLDEST_CONTACT_AGE"|"CONTACTS_SCHEDULED"|"AGENTS_ON_CONTACT"|"SLOTS_ACTIVE"|"SLOTS_AVAILABLE"|"ESTIMATED_WAIT_TIME",
MetricId = "string",
Unit = "SECONDS"|"COUNT"|"PERCENT"
)
),
NextToken = "string",
MaxResults = 123,
SortCriteria = list(
list(
SortByMetric = "AGENTS_ONLINE"|"AGENTS_AVAILABLE"|"AGENTS_ON_CALL"|"AGENTS_NON_PRODUCTIVE"|"AGENTS_AFTER_CONTACT_WORK"|"AGENTS_ERROR"|"AGENTS_STAFFED"|"CONTACTS_IN_QUEUE"|"OLDEST_CONTACT_AGE"|"CONTACTS_SCHEDULED"|"AGENTS_ON_CONTACT"|"SLOTS_ACTIVE"|"SLOTS_AVAILABLE"|"ESTIMATED_WAIT_TIME",
SortOrder = "ASCENDING"|"DESCENDING"
)
)
)