Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Performance data

May
12,939
171
I had my first run-in with the PDH (Perf Data Helper) API today. It's nice ... easy to use, gets perf data faster than a WMI query would, and it does so without any surrogate processes (WmiPrsSE.EXE). You can see a list of what info is available with this command (typeperf.exe is a Windows utility in System32). Here, there are 1779 counters.
Code:
typeperf -q
TYPEPERF will also query counters, even monitor them, but not in a particularly nice format.
Code:
v:\> typeperf "\System\System Up Time" -sc 1

"(PDH-CSV 4.0)","\\ZZ\System\System Up Time"
"07/15/2014 22:21:56.714","1669114.973423"

The command completed successfully.
A generic @PERFDATA[] plugin would be easy. The user would have to provide the name of the counter (exactly as TYPEPERF -Q displays it). Also possible is a (small) number of internal variables ( _VAR ) that target specific counters of interest.

Any interest?
 
Further to what Vince said, the GUI version of this can be found in the Reliability and Performance Monitor that comes with Windows Vista and above;
Code:
"C:\Windows\system32\mmc.exe" "C:\Windows\System32\perfmon.msc" /s

From the GUI, open Monitoring Tools, select Performance Monitor.

Right-click Performance Monitor, select the Data tab, click the Add... button, and select your counter.

This information can also be accessed via the .NET Framework, and PowerShell.

A plugin would be useful, as I presently monitor the Network Interface for my D-Link Wireless Adapter.

Joe
 
On my system, to find the instance of my D-Link Wireless Adapter, I use the following command;
Code:
typeperf.exe -qx | find "Network Interface"
which returns;
Code:
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Bytes Total/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Bytes Total/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Received/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Received/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Sent/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Sent/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Current Bandwidth
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Current Bandwidth
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Bytes Received/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Bytes Received/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Received Unicast/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Received Unicast/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Received Non-Unicast/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Received Non-Unicast/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Received Discarded
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Received Discarded
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Received Errors
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Received Errors
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Received Unknown
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Received Unknown
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Bytes Sent/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Bytes Sent/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Sent Unicast/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Sent Unicast/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Sent Non-Unicast/sec
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Sent Non-Unicast/sec
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Outbound Discarded
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Outbound Discarded
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Packets Outbound Errors
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Packets Outbound Errors
\Network Interface(Intel[R] 82567LM-3 Gigabit Network Connection)\Output Queue Length
\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Output Queue Length
which allows me to select the specific counter that I require;
Code:
typeperf.exe "\Network Interface(D-Link DWA-525 Wireless N 150 Desktop Adapter[rev.A2])\Bytes Total/sec"
Joe
 
Back
Top