Performance counter summary The cmdlet groups performance counters into sets. We can investigate what sets are available by running Get-Counter -ListSet * as shown below. This returns all sets available on your machine. The sets you see will be different depending on whether you have SQL installed, Hyper-V, Exchange, and so on. Many different products add their own performance counters. Viewing all counter sets Let's say we need to find some information about processes. I can narrow down this list by defining Process for the ListSet value and running Get-Counter -ListSet Process. Process ListSet Let's assign a variable to this counter set and then check out the Counter property, which lists all individual counters part of this set. $set = Get-Counter -ListSet Process $set. Counter Counters in process counter set Now that I know all the counter names, I can pass one of these directly to Get-Counter. The counters above match to all processes. I can replace that asterisk with the process name to narrow it down to one particular process.
When a system is broken down into multiple processes - each with its own queue - it allows identifying which process is the bottleneck by examining how many messages (on average) are in each queue. However, it is not possible to know how long messages are waiting in each queue - which is the primary indicator of a bottleneck - without knowing the rate of messages coming into each queue, and the rate at which messages are being processed from each queue. Despite the many performance counters Microsoft provides for MSMQ (including messages in queues, machine-wide incoming and outgoing messages per second, and the total messages in all queues), there is no built-in performance counter for the time it takes a message to get through each queue. NServiceBus includes several performance counters to address this. They are installed in the NServiceBus category. Since all performance counters in Windows are exposed via Windows Management Instrumentation (WMI), it is very straightforward to pull this information into the existing monitoring infrastructure.