Skip to Content

Scripting Example - Processes

This examples demonstrates how to fill an event table using an action registered on the Filter event. In this example, the table is populated with a list of system processes.

Table Schema

Column Data Type Primary Key Auto-generate Nullable
Id INTEGER Yes No No
ProcessName NVARCHAR(50) No No No
WorkingSet BIGINT No No No

Script

using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

Process[] processes = Process.GetProcesses();

Table.Total = processes.Length;

IEnumerable<Process> range = processes.Skip(Table.Filter.Skip)
                                      .Take(Table.Filter.Limit ?? processes.Length)
                                      .ToList();

foreach (Process process in range)
{
    EventRow row = Table.CreateRow();

    row["Id"].Value = process.Id;
    row["ProcessName"].Value = process.ProcessName;
    row["WorkingSet"].Value = process.WorkingSet64;
}

Limitations

This example does not support the following features:

  • Sorting
  • Filtering
  • Keyword Search