Collection volumes
This page shows you how to get started using the collection volumes mediarithmics API to query the number of elements indexed in mediarithmics.
For each datamart collection, you can get the number of elements which were indexed at a given time.
This API is a mediarithmics Data cube and works similarly as Activities analytics queries API.

Quickstart

post
https://api.mediarithmics.com
/v1/platform_monitoring/collections
Here is a sample body payload with all the important properties:
1
{
2
// Retrieve the data in the specified date range
3
// Mandatory
4
"date_ranges": [
5
{
6
"start_date": "2021-10-10T00:00:00",
7
"end_date": "2021-10-25T23:59:59"
8
}
9
],
10
// List of dimensions to retrieve
11
"dimensions": [
12
{
13
"name": "date_time"
14
},
15
{
16
"name": "community_id"
17
},
18
{
19
"name": "collection"
20
}
21
],
22
// Filters on dimensions
23
"dimension_filter_clauses": {
24
"operator": "AND",
25
"filters": [
26
{
27
"dimension_name": "community_id",
28
"operator": "EXACT",
29
"expressions": [
30
100
31
]
32
}
33
]
34
},
35
// List of metrics to retrieve
36
"metrics": [
37
{
38
"expression": "count"
39
}
40
]
41
}
Copied!

Important note :

  • You must specify at least one dimension filter clause on either community_id, organisation_id or datamart_id .
  • The only operator allowed for the dimension_filter_clauses is AND.

Measure

Collection counts are retrieved every day through OTQL queries, for each indexed collection. A collection is indexed if it is in your schema. Volumes for non indexed collections are not computed. For more information on collections indexing, see Data model.
Hereunder is a description of the queries we use to compute the volumes.
The OTQL query is automatically adapted in case the runtime schema is using the @Mirror directive.
Collection name
OTQL query
UserPoint
SELECT @count{} FROM UserPoint
UserAccount
SELECT @count{} FROM UserAccount
UserEmail
SELECT @count {} FROM UserEmail
UserAgent
SELECT @count {} FROM UserAgent
UserProfile
SELECT @count {} FROM UserProfile
UserActivity
SELECT @count {} FROM UserActivity
UserEvent
SELECT @count {} FROM UserEvent
UserSegment
SELECT @count {} FROM UserSegment
UserChoice
SELECT @count {} FROM UserChoice
UserScenario
SELECT @count {} FROM UserScenario

Retention

These aggregated stats are kept for two years.

Supported dimensions and metrics

See Dimensions and metrics for the complete list of supported dimensions and metrics.

Learning more about data cubes

This endpoint is a mediarithmics Data cube. You can find documentation on how data cubes work and which data cubes are available in the specific documentation section.