Windows Process Metrics

This agent monitor plugin records CPU consumption, memory usage, and other metrics for a specified process on a Windows system. You can use this plugin to record resource usage for a web server, database, or other application.

An agent monitor plugin is a component of the Scalyr Agent. To use a plugin, simply add it to the monitors section of the Scalyr Agent configuration file (``C:\Program Files (x86)\Scalyr\config\agent.json`). For more information, see Agent Plugins.

Sample Configuration

Here is a simple configuration fragment showing use of the windows_process_metrics plugin. This sample will record resource usage for any process whose command line contains a match for the regular expression java.*tomcat6:

monitors: [
  {
     module:      "scalyr_agent.builtin_monitors.windows_process_metrics",
     id:          "tomcat",
     commandline: "java.*tomcat6",
  }
]

To record information for more than one process, use several copies of the windows_process_metrics plugin in your configuration.

Viewing Data

After adding this plugin to the agent configuration file, wait one minute for data to begin recording. Then click the Dashboards menu and select Windows Process Metrics. (The dashboard will not be listed until the agent begins sending data.)

You'll have to edit the dashboard file for each id value you've used. From the dashboard page, click the Edit Dashboard link. Look for the following bit of code, near the top of the file:

  // On the next line, list each "id" that you've used in a windows_process_metrics
  // clause in the Scalyr Agent configuration file (agent.json).
  values: [ "agent" ]

Edit the values list according to the list of ids you've used. For instance, if you've used "tomcat" (as in the example above), the list would look like this:

  values: [ "agent", "tomcat" ]

The "agent" ID is used to report metrics for the Scalyr Agent itself.

You can now return to the dashboard. Use the dropdowns near the top of the page to select the host and process you'd like to view.

Configuration Reference

Option Usage
module Always scalyr_agent.builtin_monitors.windows_process_metrics
commandline A regular expression which will match the command line or name of the process you're interested in, as shown in the output of tasklist or wmic process list. (If multiple processes match the same command line pattern, only one will be monitored.)
pid The pid of the process from which the monitor instance will collect metrics. This is ignored if the commandline is specified.
id Included in each log message generated by this monitor, as a field named instance. Allows you to distinguish between values recorded by different instances of this monitor.

Log Reference

Each event recorded by this plugin will have the following fields:

Field Meaning
monitor Always windows_process_metrics.
instance The id value from the monitor configuration, e.g. iis.
app Same as instance; provided for compatibility with the original Scalyr Agent.
metric The name of a metric being measured, e.g. "winproc.cpu".
value The metric value.

Metrics

The tables below list all metrics recorded by the monitor. They are broken up into different categories.

CPU metrics

Metric Fields Description
winproc.cpu type=user The number of seconds the CPU has spent executing instructions in user space.
winproc.cpu type=system The number of seconds the CPU has spent executing instructions in kernel space.

General metrics

Metric Description
winproc.uptime The number of seconds since the process was created.
winproc.threads The number of threads being used by the process.

Memory metrics

Metric Fields Description
winproc.mem.bytes type=working_set The number of bytes of physical memory used by the process's working set. This is the amount of memory that needs to be paged in for the process to execute.
winproc.mem.bytes type=peak_working_set The peak working set size for the process since creation time, in bytes.
winproc.mem.bytes type=paged_pool The paged-pool usage, in bytes. This is the amount of bytes of swappable memory in use.
winproc.mem.bytes type=peak_paged_pool The peak paged-pool usage, in bytes.
winproc.mem.bytes type=nonpaged_pool The nonpaged pool usage, in bytes. This is the amount of memory in use that cannot be swapped out to disk.
winproc.mem.bytes type=peak_nonpaged_pool The peak nonpaged pool usage, in bytes.
winproc.mem.bytes type=pagefile The current pagefile usage, in bytes. The is the total number of bytes the system has committed for this running process.
winproc.mem.bytes type=peak_pagefile The peak pagefile usage, in bytes.
winproc.mem.bytes type=rss The current resident size in bytes. This should be the same as the working set.
winproc.mem.bytes type=vms The current virtual memory size in bytes. This does not include shared pages.

Disk metrics

Metric Fields Description
winproc.disk.ops type=read The number of disk read requests issued by the process since creation time.
winproc.disk.ops type=write The number of disk write requests issued by the process since creation time.
winproc.disk.bytes type=read The number of bytes read from disk by the process.
winproc.disk.bytes type=write The number of bytes written to disk by the process.