Skip to content

Commit

Permalink
mod_dropmon count event samples suppressed by rate-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
sflow committed Mar 31, 2023
1 parent 8fa5d51 commit 88d93e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/Linux/hsflowd.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ extern "C" {
VMTYPE_KVM,
VMTYPE_DOCKER,
VMTYPE_SYSTEMD,
VMTYPE_CONTAINERD } EnumVMType;
VMTYPE_CONTAINERD,
VMTYPE_POD } EnumVMType;

typedef struct _HSPGpuID {
char uuid[16];
Expand Down Expand Up @@ -466,6 +467,7 @@ extern "C" {
HSP_TELEMETRY_FLOW_SAMPLES_SUPPRESSED,
HSP_TELEMETRY_COUNTER_SAMPLES_SUPPRESSED,
HSP_TELEMETRY_EVENT_SAMPLES,
HSP_TELEMETRY_EVENT_SAMPLES_SUPPRESSED,
HSP_TELEMETRY_NUM_COUNTERS
} EnumHSPTelemetry;

Expand All @@ -480,6 +482,7 @@ extern "C" {
"flow_samples_suppressed",
"counter_samples_suppressed",
"event_samples",
"event_samples_suppressed"
};
#endif

Expand Down
3 changes: 2 additions & 1 deletion src/Linux/mod_dropmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ That would allow everything to stay on the stack as it does here, which has nice
if(mdata->quota <= 0) {
myDebug(2, "dropmon: rate-limit (%u/sec) exceeded. Dropping drop", sp->dropmon.limit);
mdata->noQuota++;
sp->telemetry[HSP_TELEMETRY_EVENT_SAMPLES_SUPPRESSED]++;
return;
}
else
Expand Down Expand Up @@ -905,7 +906,7 @@ That would allow everything to stay on the stack as it does here, which has nice

SEMLOCK_DO(sp->sync_agent) {
sfl_notifier_writeEventSample(notifier, &discard);
sp->telemetry[HSP_TELEMETRY_COUNTER_SAMPLES]++;
sp->telemetry[HSP_TELEMETRY_EVENT_SAMPLES]++;
}

// first successful event confirms we are up and running
Expand Down

0 comments on commit 88d93e6

Please sign in to comment.