diff --git a/include/ntop_defines.h b/include/ntop_defines.h index 72cf79c366..c24252f61b 100644 --- a/include/ntop_defines.h +++ b/include/ntop_defines.h @@ -857,7 +857,7 @@ #define NO_HOST_POOL_ID 0 /* Flow aggregation duration is expressed in housekeeping periods. If housekeeping frequency is 5 secs, a flow aggregation duration of 12 equals to 1 minute. */ -#define FLOW_AGGREGATION_DURATION 12 * 5 /* 1 minute * 5 = 5 minutes */ +#define FLOW_AGGREGATION_DURATION 1 * 5 /* 1 minute * 5 = 5 minutes */ #define FLOW_AGGREGATION_MAX_AGGREGATES 1000 #ifdef DONT_USE_LUAJIT diff --git a/scripts/locales/en.lua b/scripts/locales/en.lua index e13919e0a7..ef71fc805e 100644 --- a/scripts/locales/en.lua +++ b/scripts/locales/en.lua @@ -2356,7 +2356,7 @@ local lang = { ["toggle_email_notification_title"] = "Toggle Email Notification", ["toggle_flow_alerts_iface_description"] = "Enable flow alert generation when the network interface is alerted.", ["toggle_flow_alerts_iface_title"] = "Enable Flow Alerts", - ["toggle_flow_db_dump_export_description"] = "Toggle the export of tiny flows, that are flows with few packets or bytes.Reduces flow cardinality in databases, speeds-up insert and searched. Tuning tiny flows can help to limit flow cardinality while not reducing visibility on dumped information.", + ["toggle_flow_db_dump_export_description"] = "Toggle the export of tiny flows, that are flows with few packets or bytes. Reduces flow cardinality in databases, speeds-up inserts and searches. Tuning tiny flows can help to limit flow cardinality while not reducing visibility on dumped information.", ["toggle_flow_db_dump_export_title"] = "Tiny Flows Export", ["toggle_flow_rrds_description"] = "Toggle the creation of bytes timeseries for each port of the remote device as received through ZMQ (e.g. sFlow/NetFlow/SNMP).
For non sFlow devices, %%INPUT_SNMP and %%OUTPUT_SNMP must appear into the nprobe template.", ["toggle_flow_rrds_title"] = "Flow Devices", diff --git a/scripts/lua/admin/prefs.lua b/scripts/lua/admin/prefs.lua index bf0972fbf8..3f151eba71 100644 --- a/scripts/lua/admin/prefs.lua +++ b/scripts/lua/admin/prefs.lua @@ -1422,17 +1422,21 @@ function printFlowDBDump() print('') print('') + local tiny_to_switch = {"max_num_packets_per_tiny_flow", "max_num_bytes_per_tiny_flow"} + prefsToggleButton({ field = "toggle_flow_db_dump_export", default = "1", - pref = "flow_db_dump_export_enabled", + pref = "tiny_flows_export_enabled", }) prefsInputFieldPrefs(subpage_active.entries["max_num_packets_per_tiny_flow"].title, subpage_active.entries["max_num_packets_per_tiny_flow"].description, - "ntopng.prefs.", "max_num_packets_per_tiny_flow", prefs.max_num_packets_per_tiny_flow, "number", true, false, nil, {min=1, max=2^32-1}) + "ntopng.prefs.", "max_num_packets_per_tiny_flow", prefs.max_num_packets_per_tiny_flow, "number", + true, false, nil, {min=1, max=2^32-1}) prefsInputFieldPrefs(subpage_active.entries["max_num_bytes_per_tiny_flow"].title, subpage_active.entries["max_num_bytes_per_tiny_flow"].description, - "ntopng.prefs.", "max_num_bytes_per_tiny_flow", prefs.max_num_bytes_per_tiny_flow, "number", true, false, nil, {min=1, max=2^32-1}) + "ntopng.prefs.", "max_num_bytes_per_tiny_flow", prefs.max_num_bytes_per_tiny_flow, "number", + true, false, nil, {min=1, max=2^32-1}) print('') diff --git a/src/NetworkInterface.cpp b/src/NetworkInterface.cpp index d36e04c0de..3845ea3d97 100644 --- a/src/NetworkInterface.cpp +++ b/src/NetworkInterface.cpp @@ -878,7 +878,15 @@ void NetworkInterface::dumpAggregatedFlow(AggregatedFlow *f) { f->print(buf, sizeof(buf))); #endif - db->dumpAggregatedFlow(f); + if(!ntop->getPrefs()->is_tiny_flows_export_enabled() && f->isTiny()) { +#ifdef DUMP_AGGREGATED_FLOW_DEBUG + ntop->getTrace()->traceEvent(TRACE_NORMAL, + "Skipping tiny aggregated flow [flow: %s]", + f->print(buf, sizeof(buf))); +#endif + } else { + db->dumpAggregatedFlow(f); + } } }
'..i18n("prefs.tiny_flows")..'