feat: add metrics publisher for NT (#1791)

Publishes metrics to NT using a protobuf under
`photonvision/coprocessors/metrics` using the device host name as the
key.

Refactors metrics to use numbers where possible, instead of strings.

Removes GPU mem display from metrics card when it can't be determined.

Updates UI metrics periodically.

Resolves #1988

Closes #830

---------

Co-authored-by: Matt <matthew.morley.ca@gmail.com>
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com>
This commit is contained in:
Sam Freund
2025-07-12 04:40:58 -05:00
committed by GitHub
parent d7e536dda9
commit 7f6edcd567
15 changed files with 383 additions and 117 deletions

View File

@@ -68,3 +68,17 @@ message ProtobufPhotonPipelineResult {
int64 nt_publish_timestamp_micros = 6;
int64 time_since_last_pong_micros = 7;
}
message ProtobufDeviceMetrics {
double cpu_temp = 1;
double cpu_util = 2;
string cpu_thr = 3;
double ram_mem = 4;
double ram_util = 5;
double gpu_mem = 6;
double gpu_mem_util = 7;
double disk_util_pct = 8;
repeated double npu_usage = 9;
string ip_address = 10;
double uptime = 11;
}