vmware / vmware/pyvmomi

Slow API for Extracting small piece of data from Performance Manager

Open
#782 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs verification
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

I was trying to extract the average CPU usage of multiple VMs using this API, and used a similiar approach as in one of the sample codes. I have been extracting this data by doing this the following(pseudo-code):-
=======================================================
containerView = content.viewManager.CreateContainerView(container,viewType,recursive)
counterIDs = [0,1] //IDs for CPU usage
metricIDs = [vim.PerformanceManager.MetricId(counterId=c, instance="*") for c in counterIDs]
//Build a spec
spec = vim.PerformanceManager.QuerySpec(maxSample=1,entity=child,metricId=metricIDs,intervalId=20)
//Get results by querying PerfManager
result = perfManager.QueryStats(querySpec=[spec])
// Parse result to get the data

========================================================
It seems that the API seems to send multiple set packets of information to and fro thereby making this extraction quite slow. Is there a faster way to extract just this small piece of information of CPU usage instead of exchanaging large packets of data to and fro?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the PerformanceManager QueryStats call and the sample approach shown in the issue, including CreateContainerView and QuerySpec. Determine whether the API supports a narrower CPU-usage request or a more efficient retrieval path, then verify the result against the reported packet volume and extraction speed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend, performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.