feat: measure latency

This commit is contained in:
2025-09-25 21:54:25 +02:00
parent 356ec3d381
commit 096cf12704
3 changed files with 11 additions and 5 deletions

View File

@@ -43,5 +43,6 @@ private:
void onHeartbeat(const char* msg);
void onResponse(const char* msg);
void onNodeInfo(const char* msg);
unsigned long lastHeartbeatSentAt = 0;
std::vector<MessageHandler> messageHandlers;
};

View File

@@ -17,7 +17,7 @@ struct NodeInfo {
uint32_t cpuFreqMHz = 0;
uint32_t flashChipSize = 0;
} resources;
unsigned long latency = 0; // ms since lastSeen
unsigned long latency = 0; // ms from heartbeat broadcast to NODE_INFO receipt
std::vector<EndpointInfo> endpoints; // List of registered endpoints
std::map<String, String> labels; // Arbitrary node labels (key -> value)
};