2025-11-22 02:16:10 +01:00
using System.Runtime.Versioning ;
namespace ElectronNET.API.Entities
2017-10-14 00:06:58 +02:00
{
2017-10-24 21:43:27 +02:00
/// <summary>
2025-11-09 02:30:31 +01:00
/// Process metrics information.
2017-10-24 21:43:27 +02:00
/// </summary>
2025-11-22 02:16:10 +01:00
/// <remarks>Up-to-date with Electron API 39.2</remarks>
2017-10-14 00:06:58 +02:00
public class ProcessMetric
{
2020-05-31 03:09:54 +02:00
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the process id of the process.
2020-05-31 03:09:54 +02:00
/// </summary>
public int PId { get ; set ; }
2017-10-14 00:06:58 +02:00
2020-05-31 03:09:54 +02:00
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the process type. One of: Browser | Tab | Utility | Zygote | Sandbox helper | GPU | Pepper Plugin | Pepper Plugin Broker | Unknown.
2020-05-31 03:09:54 +02:00
/// </summary>
public string Type { get ; set ; }
2017-10-14 00:06:58 +02:00
2020-05-31 03:09:54 +02:00
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the CPU usage of the process.
2020-05-31 03:09:54 +02:00
/// </summary>
public CPUUsage Cpu { get ; set ; }
2017-10-14 00:06:58 +02:00
2020-05-31 03:09:54 +02:00
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the creation time for this process, represented as the number of milliseconds since the UNIX epoch. Since the pid can be reused after a process dies, use both pid and creationTime to uniquely identify a process.
2020-05-31 03:09:54 +02:00
/// </summary>
2025-11-09 02:30:31 +01:00
public double CreationTime { get ; set ; }
2020-05-31 03:09:54 +02:00
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the memory information for the process.
2020-05-31 03:09:54 +02:00
/// </summary>
public MemoryInfo Memory { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets a value indicating whether the process is sandboxed on OS level.
2020-05-31 03:09:54 +02:00
/// </summary>
2025-11-22 02:16:10 +01:00
[SupportedOSPlatform("macos")]
[SupportedOSPlatform("windows")]
2020-05-31 03:09:54 +02:00
public bool Sandboxed { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the integrity level. One of: untrusted | low | medium | high | unknown.
2020-05-31 03:09:54 +02:00
/// </summary>
2025-11-22 02:16:10 +01:00
[SupportedOSPlatform("windows")]
2020-05-31 03:09:54 +02:00
public string IntegrityLevel { get ; set ; }
2025-11-02 02:43:16 +01:00
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the name of the process. Examples for utility: Audio Service, Content Decryption Module Service, Network Service, Video Capture, etc.
2025-11-02 02:43:16 +01:00
/// </summary>
public string Name { get ; set ; }
/// <summary>
2025-11-22 02:16:10 +01:00
/// Gets or sets the non-localized name of the process.
2025-11-02 02:43:16 +01:00
/// </summary>
public string ServiceName { get ; set ; }
2017-10-14 00:06:58 +02:00
}
2020-05-31 03:09:54 +02:00
}