improve stats reporting

now again use three messages to transmit stats (much more efficient than
sending single values, also more acurate).
This commit is contained in:
Martin Preuss
2025-08-25 10:22:05 +02:00
parent 7efaf720cc
commit 6e062d3f60
13 changed files with 234 additions and 186 deletions

View File

@@ -19,12 +19,20 @@
#define AQH_MSG_OFFS_RECVSTATS_UID 0 /* 4 bytes */
#define AQH_MSG_OFFS_RECVSTATS_PACKETSIN 4 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_CRCERRORS 6 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_IOERRORS 8 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_NOBUFFER 10 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_HANDLED 12 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_MISSED 14 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_IFACE 4 /* 1 byte */
#define AQH_MSG_OFFS_RECVSTATS_PACKETSIN 5 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_CRCERRORS 7 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_IOERRORS 9 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_NOBUFFER 11 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_HANDLED 13 /* 2 bytes */
#define AQH_MSG_OFFS_RECVSTATS_MISSED 15 /* 2 bytes */
uint8_t AQH_RecvStatsMessage_GetInterface(const AQH_MESSAGE *msg)
{
return AQH_Message_ReadUint8At(msg, AQH_MSG_OFFS_ALL_DATA_BEGIN+AQH_MSG_OFFS_RECVSTATS_IFACE, 0);
}
@@ -80,12 +88,13 @@ uint16_t AQH_RecvStatsMessage_GetMissed(const AQH_MESSAGE *msg)
void AQH_RecvStatsMessage_DumpToBuffer(const AQH_MESSAGE *msg, GWEN_BUFFER *dbuf, const char *sText)
{
GWEN_Buffer_AppendArgs(dbuf,
"0x%02x->0x%02x: RECVSTATS %s "
"(uid=0x%08x, in=%d, crc errs=%d, io errs=%d, nobuf errs=%d, handled=%d, missed=%d)\n",
"0x%02x->0x%02x: RECVSTATS %s"
"(uid=0x%08x, dev=%d, in=%d, crc errs=%d, io errs=%d, nobuf errs=%d, handled=%d, missed=%d)\n",
AQH_NodeMessage_GetSourceAddress(msg),
AQH_NodeMessage_GetDestAddress(msg),
sText,
(unsigned int) AQH_RecvStatsMessage_GetUid(msg),
AQH_RecvStatsMessage_GetInterface(msg),
AQH_RecvStatsMessage_GetPacketsIn(msg),
AQH_RecvStatsMessage_GetCrcErrors(msg),
AQH_RecvStatsMessage_GetIoErrors(msg),