From 2dfa4cecb59114b9f4d6cc6c8e6f128fda2eab40 Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Sun, 24 Mar 2024 08:22:34 -0400 Subject: [PATCH] stats: Memcap pressure max relocation This commit moves the memcap pressure/pressure_max stats from the global stats namespace into the memcap namespace. With per-thread stats, they will be within the flow-manager's values. Issue: 6398 --- etc/schema.json | 24 +++++++++++++++--------- src/flow-manager.c | 4 ++-- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/etc/schema.json b/etc/schema.json index 15f148e4f6..a90630d164 100644 --- a/etc/schema.json +++ b/etc/schema.json @@ -3734,15 +3734,6 @@ } } }, - "memcap_pressure": { - "description": - "Percentage of memcaps used by flow, stream, stream-reassembly and app-layer-http", - "type": "integer" - }, - "memcap_pressure_max": { - "description": "Maximum memcap_pressure seen by the engine", - "type": "integer" - }, "app_layer": { "type": "object", "properties": { @@ -5298,6 +5289,21 @@ }, "additionalProperties": false }, + "memcap": { + "type": "object", + "properties": { + "pressure": { + "description": + "Percentage of memcaps used by flow, stream, stream-reassembly and app-layer-http", + "type": "integer" + }, + "pressure_max": { + "description": "Maximum pressure seen by the engine", + "type": "integer" + } + }, + "additionalProperties": false + }, "ftp": { "type": "object", "properties": { diff --git a/src/flow-manager.c b/src/flow-manager.c index bcc1498c8b..279910cb85 100644 --- a/src/flow-manager.c +++ b/src/flow-manager.c @@ -654,8 +654,8 @@ static void FlowCountersInit(ThreadVars *t, FlowCounters *fc) fc->flow_bypassed_pkts = StatsRegisterCounter("flow_bypassed.pkts", t); fc->flow_bypassed_bytes = StatsRegisterCounter("flow_bypassed.bytes", t); - fc->memcap_pressure = StatsRegisterCounter("memcap_pressure", t); - fc->memcap_pressure_max = StatsRegisterMaxCounter("memcap_pressure_max", t); + fc->memcap_pressure = StatsRegisterCounter("memcap.pressure", t); + fc->memcap_pressure_max = StatsRegisterMaxCounter("memcap.pressure_max", t); } static void FlowCountersUpdate(