Query usage data from Tiered Cache
Read the requests Tiered Cache processed and the data it transferred, with a consumption query in the GraphiQL Playground.
The workloadConsumptionMetrics dataset returns aggregated consumption data for Azion products, including Tiered Cache. You query it through the GraphQL API, and the data is available for up to 24 months.
This guide runs the query in the GraphiQL Playground. The same query works from any GraphQL client that sends your credentials.
Prerequisites
- An Azion account, signed in. The Playground returns an error message for a request that carries no session.
- Access to the GraphiQL Playground.
Query the requests and the data transferred
The query filters the dataset by product and by a time range, then sums the accounted usage per metric. To run it:
Go to https://api.azion.com/v4/consumption/graphql.
The productId 1564082375 is Tiered Cache. Adjust begin and end to the period you want to read:
The response carries one object per group, with the summed usage in total:
You now have the requests Tiered Cache processed and the bytes it transferred in the period, per workload.
Query fields
| Field | What it carries |
|---|---|
filter | The criteria that narrow the returned data |
tsRange | A subfield of filter, with a begin and an end timestamp in the format YYYY-MM-DDTHH:mm:ss |
productId | The product the rows belong to. Tiered Cache is 1564082375 |
metricNameIn | The metrics to return. This query reads data_transferred_total and requests |
aggregate | With sum: accounted, the accounted usage of every event matching the filters and the groups |
limit | The maximum number of results. The system maximum is 10000 |
groupBy | The fields the results are grouped by |
Response fields
| Field | What it carries |
|---|---|
clientId | The unique identifier of the client on Azion. For example: 8437r |
workloadId | The identifier of the workload the usage belongs to. For example: 4829103746 |
productId | The product the row belongs to |
metricName | The metric the row reports |
total | The summed value of the metric. For data_transferred_total, the bytes Tiered Cache transferred. For requests, the requests it processed |
For every field of the dataset, refer to Consumption GraphQL API fields.