2021年3月30日星期二

Kusto query calculate 2 metric fields

I'm doing a query in Kusto on Azure to bring the memory fragmentation value of Redis, this value is obtained by dividing the RSS memory by the memory used, the problem is that I am not able to do the calculation using these two different fields because it is necessary to filter the value of the "Average" field of the "usedmemoryRss" and "usedmemory" fields when I do the filter on the extend line the query returns no value, the code looks like this:

AzureMetrics  | extend m1 = Average | where MetricName == "usedmemoryRss" and   | extend m2 = Average | where MetricName == "usedmemory"  | extend teste = m1 / m2  

When I remove the "where" clauyse from the lines it divides the value of each record by itself and return 1. Is it possible to do that? Thank you in advance for your help.

https://stackoverflow.com/questions/66876553/kusto-query-calculate-2-metric-fields March 31, 2021 at 02:30AM

没有评论:

发表评论