This API produces aggregated histogram for user-centric metrics represented as two arrays of numbers. One of these arrays is always 'uniqueUsers', and the second array is currently being limited to 'events'. If we denote the i-th number in the 'events' array as events(i) and the i-th number in the 'uniqueUsers' array as uniqueUsers(i) , then uniqueUsers(i) represents the number of users with the number of events greater than events(i-1) but smaller than or equal to events(i). Note that, similar to /traffic, ' uniqueUsers' is the number of unique Cxense-specific identities, without consideration to the identities linked by the customer. For more information see the user identities demystification page.
The API allows also to define the range of the histogram (that is the minimum and maximum value for 'events') and the number histogram buckets (i.e., list size). For example, given minimum value 1, maximum value 10, and count 10, the following figure demonstrates a visual interpretation of the results:
events | uniqueUsers | Unknown Attachment 1 | 9139931 2 | 2763238 3 | 1458519 4 | 849363 5 | 583366 6 | 387615 7 | 292537 8 | 210543 9 | 169517 10 | 128705
The user must be authenticated and have read permissions to the given sites.
Current aggregation period and filter restrictions are as follows:
|
Period |
Fields available |
Filters available |
Notes |
|---|---|---|---|
|
Last 31 days or less |
events |
All |
Currently supports only displaying the distribution of events. Any combination of filters. |
|
More than 31 days ago without long term storage |
None |
|
The data is unavailable for periods over 31 days, unless the sites are configured with long term support. |
|
More than 31 days ago with long term storage |
events |
All |
Can be used only for a single site, i.e., when the number of sites is |
Request
Similar to /traffic. However, the 'fields', 'orderBy' and history-related arguments are forbidden and the following additional arguments are supported:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
Integer |
No |
The minimum value for the histogram, must be greater than or equal to 1. The default value is 1. |
|
|
Integer |
No |
The maximum value for the histogram, must be greater than or equal to ' |
|
|
Integer |
No |
The number of histogram buckets, must be between 1 and 1000. The default value is 10. |
This API performs faster when the min-max range is small and the count is low.
Response
The response object has the following fields:
Examples
$ python cx.py /traffic/user/histogram '{"siteId":"12345", "start":"-1M", "count":10, "min":1, "max":10}'
{
"start": 1399364129,
"stop": 1402042529,
"data": {
"uniqueUsers": [
9139931,
2763238,
1458519,
849363,
583366,
387615,
292537,
210543,
169517,
128705
],
"events": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
]
}