VMware Cloud Community
nicolasd
Contributor
Contributor
Jump to solution

Perfmanager, historicalinterval scpeculation

I've been working on a script that connects to either a Host or a VC and gets all the available metrics for a specified managed entity ("HostSystem"|"VirtualMachine"|"ClusterComputeResource"|"ResourcePool"). A list of all the existing entities is outputed in the shell and the user gets to select the one he wants metrics for. The same goes for the historical interval; the user gets to select one from those available in the perfmanager's historical interval property. When there are none to choose from the script just ignores this property but still fetches all the available metrics for the selected entity. In this last case, I end up with metrics but I have no clue as to what frequency they were fetched and stored.

I want to display some of these metrics in graphs. For example, the

CPU.Usage.Average over a period of time. But how can I do this when I

dont know the sampling period? I have the values for Y....but not for X.

I'm using two ESX1 3.5 servers, one ESX 3.5 and one Virtual Center 2.5 to test my script. The two ESXi do NOT have any historical intervals. The two others do (at least one sampling period is available for each).

My question has two parts.

Firstly, why do some servers save their historical intervals and others don't. (Is this an ESXi issue? or a configuration issue?)

Secondly, can I, and if yes, how can I know what is the sampling period at which these metrics were fetched?

I'd be more than happy to add details to my question if necessary,

thanks,

Nic

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

My understadning, if you don't have a VC you will have to get the statistical data from the ESX or ESXi.

Both types have what is called the real-time interval with a sampling period of 20 secs.

On top of that the ESX seems to have the PastDay historical interval with a sampling period of 300 secs.

The PerfQuery method returns an array of PerfEntityMetric (I ignore the other type PerfEntityMetricCSV since I don't see the point in asking for the data in CSV format).

A PerfEntityMetric object contains the properties sampleInfo.interval, which gives the sampling interval, and sampleInfo.timestamp, which gives the time the data was collected.

I suspect the timestamp gives the end of the interval, lasting for interval secs, during which that instance was collected.

From these timestamps you can see that the data is sampled over 20 secs.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

To my knowledge an ESXi server also collects statistical data.

Note that the historical intervals are a functionality of the VC, not of the ESX or ESXi server.

You do connect to the VC before looking at the historical intervals ?

Perhaps an extract of the code you use would make it clear what you are trying to do.

Update:

I did a few tests against ESX and ESXi and I think I saw what you mean.

When I connect to the ESX server (not the VC) I see 1 historical interval, called PastDay, with an interval of 5 minutes.

When I connect to the ESXi server there are no historical intervals.

But like I said before, you should connect to the VC server and use the historical intervals defined on there.

Note that the consolidation of the intervals HI1 --> HI2 --> HI3 --> HI4 also happens on the VC (have a look at the scheduled SQL jobs).


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

nicolasd
Contributor
Contributor
Jump to solution

First off thanks for the quick answers. Your second comment came in while I was typing my response and you seem to understand exactly my issue.

But here's another question.

What if I didn't have a VC? And only had the two ESXi servers. How can I know what the sampling period was for each metric? Is it by default 20, 300 or X?

Is there a way to get a time stamp per metric? (maybe, time of collection + sampling period)

Nic

0 Kudos
LucD
Leadership
Leadership
Jump to solution

My understadning, if you don't have a VC you will have to get the statistical data from the ESX or ESXi.

Both types have what is called the real-time interval with a sampling period of 20 secs.

On top of that the ESX seems to have the PastDay historical interval with a sampling period of 300 secs.

The PerfQuery method returns an array of PerfEntityMetric (I ignore the other type PerfEntityMetricCSV since I don't see the point in asking for the data in CSV format).

A PerfEntityMetric object contains the properties sampleInfo.interval, which gives the sampling interval, and sampleInfo.timestamp, which gives the time the data was collected.

I suspect the timestamp gives the end of the interval, lasting for interval secs, during which that instance was collected.

From these timestamps you can see that the data is sampled over 20 secs.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
nicolasd
Contributor
Contributor
Jump to solution

I understand now why there's a crown underneath your name.

Thanks,

Nic

0 Kudos