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
This commit is contained in:
44
JMonAgent/SystemMetrics.cs
Normal file
44
JMonAgent/SystemMetrics.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
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
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user