Comments (4)
I tried it with a different vCenter and was able to get stats from the 300 intervalId. It must be a server side config.
irb(main):203:0> pm.retrieve_stats([hosts[0]], ['cpu.usagemhz'], {interval: '300', start_time: '2013-07-31 11:20:00AM'}).first[1][:metrics]
=> {"cpu.usagemhz"=>[2002, 2365, 2562, 2075, 2078, 2505, 2050, 2040, 2883, 2417, 1975, 2327, 2102, 2060, 2751, 2396, 2479, 2364, 2144, 2037, 2673, 2203, 1993, 2288, 2079, 2007, 2704, 2123, 3348, 2479, 2136, 2335, 3047, 2382, 2138, 2406, 2267, 2781, 3311, 2277, 2170, 2549, 2215, 2057, 2855, 2376, 2224, 2311, 2136, 2138, 2593, 2038, 2236, 2406, 2156, 2100, 2838, 2280, 2075, 2353, 2110, 2060, 2658, 2606, 2284, 2400, 2111, 2120, 2836, 2355, 2412, 2398]}
irb(main):204:0> pm.retrieve_stats([hosts[0]], ['cpu.usagemhz'], {interval: '300', start_time: '2013-07-31 11:20:00AM'}).first[1][:metrics]['cpu.usagemhz'].count
=> 72
one thing is it doesn't look like max_samples is working... debugging that now.
from rbvmomi.
There are different levels that govern which counter gets saved for how
long. Your counter is likely in a level where its real time only at this
point.
On Jul 31, 2013 10:36 AM, "Dan Moore" [email protected] wrote:
I tried it with a different vCenter and was able to get stats from the 300
intervalId. It must be a server side config.irb(main):203:0> pm.retrieve_stats([hosts[0]], ['cpu.usagemhz'], {interval: '300', start_time: '2013-07-31 11:20:00AM'}).first[1][:metrics]=> {"cpu.usagemhz"=>[2002, 2365, 2562, 2075, 2078, 2505, 2050, 2040, 2883, 2417, 1975, 2327, 2102, 2060, 2751, 2396, 2479, 2364, 2144, 2037, 2673, 2203, 1993, 2288, 2079, 2007, 2704, 2123, 3348, 2479, 2136, 2335, 3047, 2382, 2138, 2406, 2267, 2781, 3311, 2277, 2170, 2549, 2215, 2057, 2855, 2376, 2224, 2311, 2136, 2138, 2593, 2038, 2236, 2406, 2156, 2100, 2838, 2280, 2075, 2353, 2110, 2060, 2658, 2606, 2284, 2400, 2111, 2120, 2836, 2355, 2412, 2398]}irb(main):204:0> pm.retrieve_stats([hosts[0]], ['cpu.usagemhz'], {interval: '300', start_time: '2013-07-31 11:20:00AM'}).first[1][:metrics]['cpu.usagemhz'].count=> 72
one thing is it doesn't look like max_samples is working... debugging that
now.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/21#issuecomment-21880189
.
from rbvmomi.
Right, but that's not the problem here.
The underlying problem here is calling the counter 'cpu.usagemhz' returns the first instance of cpu.usagemhz -- which is of rollup (none) - only at logging level 4. rollup 'average' counter is at level 1. The helper function doesn't allow you to specify.
Check this doc
http://pubs.vmware.com/vsphere-51/index.jsp#com.vmware.wssdk.apiref.doc/cpu_counters.html
And this gist I wrote on the issue:
https://gist.github.com/toobulkeh/6124975
Thanks so much for replying!
from rbvmomi.
I also met the same problem. So I sent following PR:
#75
By this change, we can specify the target performance counter including RollupType like 'cpu.usagemhz.averate'. Unfortunately, it's not yet merged. It seems something verification or test is needed. But I don't know what can I do.
Anyway, I created custom gem and am using it. It's looks working well.
from rbvmomi.
Related Issues (20)
- createDate under vm config property shows empty in rbvmomi HOT 12
- Memory leak caused by at_exit {} usage HOT 4
- esxcli option not working HOT 1
- RbVmomi 2.1.0 breaks PBM HOT 6
- Drop support for all EOL Ruby versions
- Add code coverage/review tools to run for every commit/PR
- Get code coverage to a respectable level
- Revamp the VMODL DB usage HOT 1
- API to create Datastore HOT 18
- A specified parameter was not correct: HOT 11
- Trying to get an example to add an nvdimm device/host PMEM datastore to a virtual machine. I've read the docs, but I'm missing some clarity somewhere, and keep getting errors. HOT 3
- vStorageObjectManager not able to create a disk under specified folder HOT 8
- kitchen destroy stopped working on kitchen-vcenter HOT 7
- portgroup info empty HOT 5
- Error message while using esxi_cpu_stats.rb HOT 10
- Definition of StoragePod class and how to query for it? HOT 1
- Add linting/code analysis HOT 4
- Update Hash syntax HOT 6
- RbVmomi deserialization fails on managed object type `ContentLibrary` HOT 4
- New Data Types added in vSphere 7.0 U1 and U2 missing from vmodl.db
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rbvmomi.