Reputation: 1107
I've been working on Log Analytics Workspace query, there i'd like to know about the memory(RAM) being use by windows VM Specially, in linux vm we can get it from % Used Memory counter
though not able yo get Windows VM. Query for Linux Used memory is shown below:
// Memory usage
Perf
| where TimeGenerated > ago(30m)
| where CounterName == "% Used Memory"
| project TimeGenerated, CounterName, CounterValue, Computer
| summarize UsedMemory = avg(CounterValue) by CounterName, bin(TimeGenerated, 1m), Computer
| where UsedMemory > 20
| render timechart
Upvotes: 1
Views: 2087
Reputation: 324
@Sachin : You are right. "% Used Memory" is a counter available for Linux boxes only. For Windows "% Committed Bytes In Use" is the closest which can give you the current memory in use for any windows VM. The query can be the same what you have written but with the different counter name
Perf
| where TimeGenerated > ago(30m)
| where CounterName == "% Committed Bytes In Use"
| project TimeGenerated, CounterName, CounterValue, Computer
| summarize UsedMemory = avg(CounterValue) by CounterName, bin(TimeGenerated, 1m), Computer
| where UsedMemory > 20
| render timechart
Upvotes: 1
Reputation: 72181
this would work pretty much the same for windows vms, but you need to configure which counters do you gather, before this query can work.
Upvotes: 1