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:
2026-01-05 23:23:55 -06:00
commit 127b3ad5bf
16 changed files with 1241 additions and 0 deletions

View 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
{
}