From 6517cc3078eba96ea96e085d033a4b8a96eb7151 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 11 Mar 2025 16:35:08 +0100 Subject: Add EDI/TCP number of active connections statistics --- src/ManagementServer.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/ManagementServer.h') diff --git a/src/ManagementServer.h b/src/ManagementServer.h index 6e39922..c7a4222 100644 --- a/src/ManagementServer.h +++ b/src/ManagementServer.h @@ -2,7 +2,7 @@ Copyright (C) 2009 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2018 + Copyright (C) 2025 Matthias P. Braendli, matthias.braendli@mpb.li http://www.opendigitalradio.org @@ -50,6 +50,7 @@ # include "config.h" #endif +#include "Socket.h" #include "zmq.hpp" #include #include @@ -167,8 +168,10 @@ class ManagementServer void open(int listenport); /* Un-/Register a statistics data source */ - void registerInput(InputStat* is); - void unregisterInput(std::string id); + void register_input(InputStat* is); + void unregister_input(std::string id); + + void update_edi_tcp_output_stat(uint16_t listen_port, size_t num_connections); /* Load a ptree given by the management server. * @@ -205,20 +208,25 @@ class ManagementServer std::thread m_restarter_thread; /******* Statistics Data ********/ - std::map m_inputStats; + std::map m_input_stats; + + // Holds information about EDI/TCP outputs + std::map m_output_stats; /* Return a description of the configuration that will * allow to define what graphs to be created * * returns: a JSON encoded configuration */ - std::string getStatConfigJSON(); + std::string get_input_config_json(); /* Return the values for the statistics as defined in the configuration * * returns: JSON encoded statistics */ - std::string getValuesJSON(); + std::string get_input_values_json(); + + std::string get_output_values_json(); // mutex for accessing the map std::mutex m_statsmutex; -- cgit v1.2.3