commit ab3209a69347036cd6d886b53fac89e7c74364d9
parent 2c2573f66c22ef6bcf083c6ac598faf11e61b818
Author: Remy Noulin <loader2x@gmail.com>
Date: Sat, 8 Jul 2023 20:41:02 +0200
comment out system to detect when packets arrive too fast
because when packets are delayed, the next one arrives fast
heartbeat.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
Diffstat:
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/heartbeat.c b/heartbeat.c
@@ -750,15 +750,17 @@ void probe(char *cfgfile) {
// update state for this agent
cleanFinishSmallDictP(agent) = getG(completeCfg, rtSmallDictt, agents[m->id]);
+ // Don't measure time between packet because
+ // they don't arrive regurlarly, some packets are delayed
/* TODO use specific period for agent */
- u64 expectedNextTime = getG(agent, rtU64, "mono") + (u64)period * 1000000000UL;
- time = getMonotonicTime();
- u64 elapsed = time - expectedNextTime;
- if (elapsed < (u64)period * 8000000000UL) {
- char *ip = inet_ntoa((client).sin_addr);
- logE("Packet from %s with ip %s came too early.", agents[m->id], ip);
- }
- setG(agent, "mono", time);
+ /* u64 expectedNextTime = getG(agent, rtU64, "mono") + (u64)period * 1000000000UL; */
+ /* time = getMonotonicTime(); */
+ /* u64 elapsed = time - expectedNextTime; */
+ /* if (elapsed < (u64)period * 800000000UL) { */
+ /* char *ip = inet_ntoa((client).sin_addr); */
+ /* logE("Packet from %s with ip %s came too early.", agents[m->id], ip); */
+ /* } */
+ /* setG(agent, "mono", time); */
setG(agent, "time", getCurrentUnixTime());
char *newstate = m->messageId ? "alive" : "init";
if (!eqG($(agent, "state"), newstate)) {