https://github.com/moteus/lua-pdh
Lua binding to Microsoft Performance Data Helper (PDH) library.
https://github.com/moteus/lua-pdh
lua lua-binding windows
Last synced: 6 months ago
JSON representation
Lua binding to Microsoft Performance Data Helper (PDH) library.
- Host: GitHub
- URL: https://github.com/moteus/lua-pdh
- Owner: moteus
- License: mit
- Created: 2013-08-09T13:55:24.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-11-16T07:34:41.000Z (over 8 years ago)
- Last Synced: 2024-10-17T16:09:54.809Z (7 months ago)
- Topics: lua, lua-binding, windows
- Language: C
- Size: 47.9 KB
- Stars: 4
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Binding to Microsoft Performance Data Helper (PDH) library
========
[](LICENCE.txt)
[](https://ci.appveyor.com/project/moteus/lua-pdh/branch/master)## Usage
```Lua
local pdh = require "pdh"assert(not pdh.disabled())
local query = pdh.query()
local path = pdh.translate_path([[\Processor(_Total)\% Processor Time]])
local counter = query:add_counter(path)query:collect()
pdh.sleep(1)
while true do
query:collect()
print(path, " => ", math.floor(counter:as_double()))
pdh.sleep(1000)
end
```[](https://bitdeli.com/free "Bitdeli Badge")