Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 180329

Get-Stat returns too many values even with MaxSamples set

$
0
0

I was having an issue with Get-Stat pulling any single value.  This command was run against 800 Esxi hosts and most took only seconds to respond on many hosts; However, I was seeing some take as long as 2 minutes....

Get-Stat -Entity ($vmHost) -start (get-date).AddDays(-1) -Finish (Get-Date) -IntervalMins 5 -stat cpu.usage.average

 

After some investigation, I found the hosts that take minutes are returning multiple 'instances' of the same value and instead of returning a few hundred records, would return 12,000 records, even for past day 5 min intervals. 

 

Thinking I could add the -MaxSamples to limit the result, I changed the command to this....

Get-Stat -Entity ($vmHost) -start (get-date).AddDays(-1) -Finish (Get-Date) -IntervalMins 5 -MaxSamples 300 -stat cpu.usage.average

or even this....

Get-Stat -Entity ($vmHost) -start (get-date).AddDays(-1) -Finish (Get-Date) -IntervalMins 5 -MaxSamples 8 -stat cpu.usage.average

 

However, I still get thousands of records back and many minutes to respond on certain ones.

 

On the fast hosts, the MaxSamples works and limits the number of records, but on the hosts that are slow, the MaxSamples seems to be ignored and still provides multiple "instances" of the object.   I have tried -Instance "" and again, the ones that are fast will respect the filter, but the ones that are slow do not.

 

This is a sample what I get regardless of the settings....

 

MetricId                             Timestamp                          Value Unit     Instance

--------                                 ---------                                  -----   ----      --------

cpu.usage.average       3/23/2020 2:05:00 PM                0.32 %        5

cpu.usage.average       3/23/2020 2:00:00 PM                0.15 %        5

cpu.usage.average       3/23/2020 1:55:00 PM                0.31 %        5

cpu.usage.average       3/23/2020 1:50:00 PM                0.54 %        5

cpu.usage.average       3/23/2020 1:45:00 PM                0.06 %        5

cpu.usage.average       3/23/2020 2:20:00 PM                0.12 %        6

cpu.usage.average       3/23/2020 2:15:00 PM                0.35 %        6

cpu.usage.average       3/23/2020 2:10:00 PM                0.49 %        6

cpu.usage.average       3/23/2020 2:05:00 PM                0.36 %        6

cpu.usage.average       3/23/2020 2:00:00 PM                 0.6 %        6

cpu.usage.average       3/23/2020 1:55:00 PM                0.26 %        6

cpu.usage.average       3/23/2020 1:50:00 PM                0.29 %        6

cpu.usage.average       3/23/2020 1:45:00 PM                0.75 %        6

cpu.usage.average       3/23/2020 2:20:00 PM                0.21 %        7

cpu.usage.average       3/23/2020 2:15:00 PM                0.42 %        7

cpu.usage.average       3/23/2020 2:10:00 PM                0.12 %        7

cpu.usage.average       3/23/2020 2:05:00 PM                0.11 %        7

cpu.usage.average       3/23/2020 2:00:00 PM                0.28 %        7

cpu.usage.average       3/23/2020 1:55:00 PM                0.11 %        7

cpu.usage.average       3/23/2020 1:50:00 PM                0.15 %        7

cpu.usage.average       3/23/2020 1:45:00 PM                0.33 %        7

cpu.usage.average       3/23/2020 2:20:00 PM                0.23 %        8

cpu.usage.average       3/23/2020 2:15:00 PM                0.33 %        8

cpu.usage.average       3/23/2020 2:10:00 PM                0.18 %        8

cpu.usage.average       3/23/2020 2:05:00 PM                 0.2 %        8

cpu.usage.average       3/23/2020 2:00:00 PM                0.06 %        8

cpu.usage.average       3/23/2020 1:55:00 PM                0.06 %        8

cpu.usage.average       3/23/2020 1:50:00 PM                0.09 %        8

cpu.usage.average       3/23/2020 1:45:00 PM                1.18 %        8

cpu.usage.average       3/23/2020 2:20:00 PM                0.11 %        9


Viewing all articles
Browse latest Browse all 180329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>