All pages
Powered by GitBook
1 of 2

Loading...

Loading...

Resources usage

This page shows you how to get started using the resources usage mediarithmics API.

Each datamart resource (segments, exports, imports...) that lead to write or read access on mediarithmics platform are tracked and their consumption are measured.

Thanks to this API you can get a report of your datamart consumption that match:

  • the cost of each query executed on the platform

  • the amount of data ingested

This API is a mediarithmics and works similarly as .

Quickstart

POST https://api.mediarithmics.com/v1/platform_monitoring/resources_usage

Request Body

Name
Type
Description

Here is a sample body payload with all the important properties:

Retention

These aggregated stats are kept for two years.

Supported dimensions and metrics

See for the complete list of supported dimensions and metrics.

Learning more about data cubes

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

Dimensions and metrics

Dimensions

The following dimensions can be requested in reports

Name
Title
Description

metrics*

array

Array of Metric to retrieve.

dimension_filter_clauses*

object

Filters to apply on dimensions before calculating the metric. For more information, see FilterClause.

dimensions*

Dimensions to group metrics by.

Dimensions to group metrics by.

date_ranges*

array

Periods to analyze. Each date range is an object with a start_date and an end_date. See DateRange.

Data cube
Activities analytics queries API
Dimensions and metrics
Data cube
{
    "status": "ok",
    "data": {
        "report_view": {
            "items_per_page": 100,
            "total_items": 7,
            "columns_headers": [
                "date_time",
                "datamart_id",
                "collection",
                "count"
            ],
            "rows": [
                [
                    1637931755000,
                    9999,
                    "USER_POINT",
                    100
                ],
                [
                    1637931755100,
                    9999,
                    "USER_EVENT",
                    50
                ]
            ]
        }
    }
}
{
    // Retrieve the data in the specified date range
    // Mandatory
    "date_ranges": [
        {
            "start_date": "2021-10-10T00:00:00",
            "end_date": "2021-10-25T23:59:59"
        }
    ],
    // List of dimensions to retrieve
    "dimensions": [
        {
            "name": "date_time"
        },
        {
            "name": "community_id"
        },
        {
            "name": "source"
        }, 
        {
            "name": "scan_cost"
        }
    ],
    // Filters on dimensions
    "dimension_filter_clauses": {
        "operator": "AND",
        "filters": [
            {
                "dimension_name": "community_id",
                "operator": "EXACT",
                "expressions": [
                    100
                ]
            }
        ]
    },
    // List of metrics to retrieve
    "metrics": [
        {
            "expression": "scan_cost"
        }
    ]
}

community_id

Community ID

The community on which the datamart is linked.

date_time

Date Time

The date and time of the datamart collection size computation in timestamp format.

Use it to know exactly when the collection volume was calculated.

execution_id

Execution ID

A resource is composed of n execution.

organisation_id

Organisation ID

The organisation on which the datamart is linked.

resource_id

Resource ID

The resource leading to write or read operations on mediarithmics platform.

source

Source

The feature tracked by the consumption monitoring system.

(E.g. : Segment computation, export ...)

sub_source

Sub Source

Contextual informations about the source. (E.g. : INSERT_PHASE for segment computation source)

Metrics

The following metrics can be displayed in reports.

Name
Title
Description

read_count

Read count

The number of top level selectors of an OTQL / GraphQL query.

The id selector of the queried object is excluded.

For example, the read count of the query SELECT { id activity_events { id } activities { id } } FROM UserPoint will be equal to 2 as there is two top level selectors (activity_events and activities ).

read_size

Read size

The number of elements queried from our database due to selection operators.

scan_size

Scan size

The number of elements queried from our database to apply the filters of a query (WHERE part).

scan_duration

Scan duration

The time spent applying filters on a query (WHERE part).

computing_unit

Computing unit

The credits used to run a query.