Files
jmon/JMonAgent/SystemMetrics.cs
James Getrost 127b3ad5bf Initial commit: JMon cross-platform monitoring system
- gRPC client-server metrics collection
- PeriodicTimer-based 5-second sampling
- Delta encoding with configurable thresholds
- Queue/retry mechanism for resilience
- ProcessId tracking for duplicate detection
- Server-side state reconstruction
- Native AOT compilation support
- Docker/Podman containerization
- PostgreSQL + TimescaleDB persistence layer
2026-01-05 23:23:55 -06:00

45 lines
1022 B
C#

using System.Text.Json.Serialization;
namespace JMonAgent;
public record SystemMetrics(
string MachineName,
string OSDescription,
double CpuUsagePercentage,
long MemoryUsedBytes,
long MemoryTotalBytes,
long SwapUsedBytes,
long SwapTotalBytes,
long DiskUsedBytes,
long DiskTotalBytes,
string DiskMountPoint,
DateTime Timestamp,
string IpAddress,
string HwId,
int ProcessId
);
public record DeltaMetrics(
string MachineName,
string? OSDescription,
double? CpuUsagePercentage,
long? MemoryUsedBytes,
long? MemoryTotalBytes,
long? SwapUsedBytes,
long? SwapTotalBytes,
long? DiskUsedBytes,
long? DiskTotalBytes,
string? DiskMountPoint,
DateTime Timestamp,
string? IpAddress,
string? HwId,
int ProcessId
);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(SystemMetrics))]
[JsonSerializable(typeof(DeltaMetrics))]
internal partial class MetricsJsonContext : JsonSerializerContext
{
}