Forum Discussion

Dante Nahuel Ciai's avatar
Dante Nahuel Ciai
Brass Contributor
Oct 08, 2020
Solved

Help understanding Processor counters

Hi all I'm trying to create a good query for Log Analytics to measure CPU average usage and peaks in order to determine whether the VM is under/over utilized. For a long time I've been using this...
  • HiDante Nahuel Ciai 

    The right query will be:

    Perf
    | where CounterName =~ '% Processor Time' and ObjectName =~ 'Processor' and InstanceName =~ '_Total' 
    | summarize AggregatedValue = avg(CounterValue) by _ResourceId

    or if you have on-premises VMs

    Perf
    | where CounterName =~ '% Processor Time' and ObjectName =~ 'Processor' and InstanceName =~ '_Total' 
    | summarize AggregatedValue = avg(CounterValue) by Computer

    Basically you only need _Total values for the counter. Besides average you can also use percentile()  . I am not sure how max() will work for you as you can have a VM that once had for a second CPU at 100% and then all the time it was as low as 1%. Overall it depends on your logic and what kind of analysis you want to do.

Resources