moteus / lua-pdh

Lua binding to Microsoft Performance Data Helper (PDH) library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binding to Microsoft Performance Data Helper (PDH) library

======== Licence Build status

Usage

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

Bitdeli Badge

About

Lua binding to Microsoft Performance Data Helper (PDH) library.

License:MIT License


Languages

Language:C 65.3%Language:CMake 30.2%Language:Lua 4.5%