This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients LorenzMende, ammar2, eryksun, heckad, paul.moore, skoslowski, steve.dower, tim.golden, vstinner, zach.ware
Date 2019-09-30.08:56:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569833775.66.0.0569298657094.issue36670@roundup.psfhosted.org>
In-reply-to
Content
We could avoid typeperf command by accessing directly performance counters:

(1) The Performance Data Helper (PDH) interface, which provides high-level access to data from both version 1 and version 2 performance counter providers.
(2) The registry interface, which provides low-level access to data from performance counter providers.
(3) The performance library interface, which provides direct access to data from version 2 performance counter providers.

https://docs.microsoft.com/en-us/windows/win32/perfctrs/consuming-counter-data

(2) in short: RegQueryValueEx() with HKEY_PERFORMANCE_DATA and the PPERF_DATA_BLOCK structure

Documentation:
https://docs.microsoft.com/en-us/windows/win32/perfctrs/using-the-registry-functions-to-consume-counter-data

PERF_DATA_BLOCK structure fields:
https://docs.microsoft.com/en-us/windows/win32/api/winperf/ns-winperf-perf_data_block

Example: https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw

Some examples mention "RegQueryValueEx function. Use HKEY_PERFORMANCE_DATA".

Performance Data Format:
https://docs.microsoft.com/en-us/windows/win32/perfctrs/performance-data-format

--

PDH & friends was discussed in bpo-34060 which added the feature to libregrtest.
History
Date User Action Args
2019-09-30 08:56:15vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, eryksun, steve.dower, ammar2, LorenzMende, skoslowski, heckad
2019-09-30 08:56:15vstinnersetmessageid: <1569833775.66.0.0569298657094.issue36670@roundup.psfhosted.org>
2019-09-30 08:56:15vstinnerlinkissue36670 messages
2019-09-30 08:56:15vstinnercreate