aboutsummaryrefslogtreecommitdiff
path: root/examples/py-flow-dashboard/plotly_dash.py
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-02-04 00:32:04 +0100
committerToni Uhlig <matzeton@googlemail.com>2022-02-04 01:12:18 +0100
commit6fd6dff14d964aa8e5cf7ff3ec5a70c220ea61b4 (patch)
tree48a59cdf9cd204577fa7706d455de9c239e13dc6 /examples/py-flow-dashboard/plotly_dash.py
parentf9e4c5885423c6f5b3d8b46c1c872b9e9330b054 (diff)
Added additional (minimalistic) detection information to flow updates.
This will only affect flows with the state `FT_FINISHED' (detection done). * nDPIsrvd.py: force use of JSON schema Draft 7 validator * flow-dash.py: gather/use total processed layer4 payload size * flow-info.py: added additional event filter * flow-info.py: prettified flow events printing whose detection is in progress * py-semantic-validation.py: added validation checks for FT_FINISHED * updated flow event JSON schema Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'examples/py-flow-dashboard/plotly_dash.py')
-rw-r--r--examples/py-flow-dashboard/plotly_dash.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/examples/py-flow-dashboard/plotly_dash.py b/examples/py-flow-dashboard/plotly_dash.py
index 4822307c0..c3ce95e12 100644
--- a/examples/py-flow-dashboard/plotly_dash.py
+++ b/examples/py-flow-dashboard/plotly_dash.py
@@ -95,7 +95,7 @@ def generate_tab_flow():
dt.DataTable(
id='table-info',
columns=[{'id': c.lower(), 'name': c, 'editable': False}
- for c in ['Key', 'Value']],
+ for c in ['Name', 'Total']],
)
], style={'display': 'flex', 'flex-direction': 'row'}),
@@ -212,13 +212,14 @@ def prettifyBytes(bytes_received):
inputs=[Input('tab-flow-default-interval', 'n_intervals')])
def tab_flow_update_components(n):
- return [[{'key': 'Total JSON Events', 'value': shared_flow_dict['total-events']},
- {'key': 'Total JSON Bytes', 'value': prettifyBytes(shared_flow_dict['total-bytes'])},
- {'key': 'Total Flows', 'value': shared_flow_dict['total-flows']},
- {'key': 'Total Risky Flows', 'value': shared_flow_dict['total-risky-flows']},
- {'key': 'Total Midstream Flows', 'value': shared_flow_dict['total-midstream-flows']},
- {'key': 'Total Guessed Flows', 'value': shared_flow_dict['total-guessed-flows']},
- {'key': 'Total Not Detected Flows', 'value': shared_flow_dict['total-not-detected-flows']}],
+ return [[{'name': 'JSON Events', 'total': shared_flow_dict['total-events']},
+ {'name': 'JSON Bytes', 'total': prettifyBytes(shared_flow_dict['total-json-bytes'])},
+ {'name': 'Layer4 Bytes', 'total': prettifyBytes(shared_flow_dict['total-l4-bytes'])},
+ {'name': 'Flows', 'total': shared_flow_dict['total-flows']},
+ {'name': 'Risky Flows', 'total': shared_flow_dict['total-risky-flows']},
+ {'name': 'Midstream Flows', 'total': shared_flow_dict['total-midstream-flows']},
+ {'name': 'Guessed Flows', 'total': shared_flow_dict['total-guessed-flows']},
+ {'name': 'Not Detected Flows', 'total': shared_flow_dict['total-not-detected-flows']}],
build_piechart(['Detected', 'Guessed', 'Not-Detected', 'Unclassified'],
[shared_flow_dict['current-detected-flows'],
shared_flow_dict['current-guessed-flows'],
@@ -355,4 +356,7 @@ def web_worker(mp_shared_flow_dict, listen_host, listen_port):
shared_flow_dict = mp_shared_flow_dict
- app.run_server(debug=False, host=listen_host, port=listen_port)
+ try:
+ app.run_server(debug=False, host=listen_host, port=listen_port)
+ except KeyboardInterrupt:
+ pass