Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
network_metrics_collector.h File Reference

Unified network metrics collector for socket buffers and TCP states. More...

#include <atomic>
#include <chrono>
#include <cstdint>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "../interfaces/metric_types_adapter.h"
#include "../plugins/collector_plugin.h"
Include dependency graph for network_metrics_collector.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::monitoring::tcp_state_counts
 Counts of connections in each TCP state. More...
 
struct  kcenon::monitoring::network_metrics_config
 Configuration for network metrics collector. More...
 
struct  kcenon::monitoring::network_metrics
 Aggregated network metrics from all sources. More...
 
class  kcenon::monitoring::network_info_collector
 Internal network data collector using platform abstraction layer. More...
 
class  kcenon::monitoring::network_metrics_collector
 Unified network metrics collector implementing collector_plugin interface. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::monitoring
 
namespace  kcenon::monitoring::platform
 

Enumerations

enum class  kcenon::monitoring::tcp_state {
  kcenon::monitoring::ESTABLISHED = 1 , kcenon::monitoring::SYN_SENT = 2 , kcenon::monitoring::SYN_RECV = 3 , kcenon::monitoring::FIN_WAIT1 = 4 ,
  kcenon::monitoring::FIN_WAIT2 = 5 , kcenon::monitoring::TIME_WAIT = 6 , kcenon::monitoring::CLOSE = 7 , kcenon::monitoring::CLOSE_WAIT = 8 ,
  kcenon::monitoring::LAST_ACK = 9 , kcenon::monitoring::LISTEN = 10 , kcenon::monitoring::CLOSING = 11 , kcenon::monitoring::UNKNOWN = 0
}
 TCP connection states as defined in RFC 793. More...
 

Functions

std::string kcenon::monitoring::tcp_state_to_string (tcp_state state)
 Convert tcp_state to string representation.
 

Detailed Description

Unified network metrics collector for socket buffers and TCP states.

This file provides a consolidated network metrics collector that combines socket buffer monitoring and TCP connection state monitoring into a single collector. This reduces code duplication and provides a unified interface for network-related metrics.

Platform APIs:

  • Linux: /proc/net/tcp, /proc/net/tcp6, /proc/net/sockstat
  • macOS: sysctlbyname, netstat equivalents
  • Windows: GetTcpStatistics(), GetExtendedTcpTable() (stub implementation)
Note
This collector consolidates the following deprecated collectors:
  • socket_buffer_collector
  • tcp_state_collector

Definition in file network_metrics_collector.h.