Search code examples
azureazure-cosmosdbazure-monitoring

Calculate the average RU/s by looking at the CosmosDB Metric Logs


I am trying to calculate the average of RU/s by looking at the CosmosDB Metric Logs.

AzureMetrics
| where MetricName == "TotalRequestUnits"

I cannot make sense of the following properties in TotalRequestUnits entries: Total, Count, Maximum, Minimum, Average. What is their meaning in this context? Which property describes the total of RUs beeing used at the time of logging?

Is it Total or Count?

Here is an example entry:

TenantId
xxx

SourceSystem
Azure

TimeGenerated [UTC]
2018-10-19T12:01:00Z

ResourceId
xxx

Resource
xxx

ResourceGroup
xxx

ResourceProvider
MICROSOFT.DOCUMENTDB

SubscriptionId
xxx

MetricName
TotalRequestUnits

Total
15,445

Count
6,585

Maximum
168

Minimum
0

Average
2.3454821564

TimeGrain
PT1M

UnitName
Count

Type
AzureMetrics

_ResourceId
xxx

The Azure Monitor Documentation is also not very clear about it: Microsoft.DocumentDB/databaseAccounts

Which property am I supposed to use to calculate the average RU/s?

Thanks for your support.


Solution

  • Which property am I supposed to use to calculate the average RU/s?

    As same as you,did not find explicit official document to explain what each of these metrics means.

    In my opinion:

    Total is total value of consumed RUs.

    Count is total counts of request records.

    So Avg = Total/Count (15445/6585) = 2.3454821564.

    Maximum is the max consumed Rus of request records which is the opposite of Minimum.

    And UnitName = Count against the Unit column in the Microsoft.DocumentDB/databaseAccounts.

    So, if you want to calculate the avg Ru/s, please refer to the AVG in your metrics log.