This post is more than 5 years old
23 Posts
0
150827
November 19th, 2012 17:00
Retrieving Memory Utilization (WCF Function)
Was hoping one of the officiando's on this board could enlighten me on what I could possibly doing wrong.
I have created a WCF dashboard that shows a VMs CPU and Memory Avg and Max Utilization for the past 30 days. The vFogkight data in the dashboard, from my reviewing of the VM through vCenter, shows correctly and is provided below
When I create a function that pulls the exact same metrics I for some reason am not getting the same information.
1. Average memory for the period appears to be correct
memAverage = virtualMachine.get("memory/hostMemory/utilization/period/average")
2. Max memory is not matching what is shown in the data chart above
memMax = virtualMachine.get("memory/hostMemory/utilization/period/max")
3. Average CPU is not matching what is shown in the data chart above
cpuAverage = virtualMachine.get("cpus/hostCPUs/utilization/period/average")
4. Max CPU for the period appears to be correct
cpuMax = virtualMachine.get("cpus/hostCPUs/utilization/period/max")
Any assistance with helping me understand where I went wrong is greatly appreciated.
Thanks,
Joshua



john_s_main
132 Posts
1
November 20th, 2012 13:00
specificTimeRange is provided automatically, based on the timeRange selected on the user's dashboard settings.
If you test the function in WCF, you get a specificTimeRange = all time. Quite annoying, really.
If you assign the result of the function to a column on a simple row-oriented table (or any view, for that matter), it inherits the dashboard timeRange automatically.
john_s_main
132 Posts
0
November 19th, 2012 17:00
Your function is pulling the average for all time. You need to include specificTimeRange in your retrieval:
memAverage = virtualMachine.get("memory/hostMemory/utilization/period/average",specificTimeRange)
jingo5star
23 Posts
0
November 20th, 2012 12:00
Thanks John for the follow up.
Is there an example you can provide for the specificTimeRange value?
john_s_main
132 Posts
0
November 20th, 2012 13:00
That doesn't matter.
If, for example, you are using the function in additional context, or even as the default value for an optional parameter, you still get the specificTimeRange set properly, since it's built into the entire dashboard context, and available to any function running within the dashboard.
jingo5star
23 Posts
0
November 20th, 2012 13:00
Unfortunately the way I am using the metrics I perform a metric review before the data would get to the dashboard and send to the dashboard a custom string depending on what threshold the metric was above or below.
jingo5star
23 Posts
0
November 20th, 2012 16:00
What you describe is exactly correct and I have corrected the time range in my row-oriented table. I have verified the metrics are correct for the time range selected and am able to perform calculations against them.
Thank You,
Joshua