ddn.util.monaco.flow
Types 6
Bandwidth information for a network connection.
This struct provides bandwidth metrics for individual network connections, including bytes and packets per second over a sampling window.
Example:
auto bandwidth = connectionBandwidth(1.seconds);
foreach (conn; bandwidth) {
writeln(conn.connection.localAddress, " -> ", conn.bytesPerSecond, " B/s");
}Socket statistics from /proc/net/tcp (Linux).
This struct contains socket-level statistics including queue sizes and connection state information.
ulong rxQueueulong txQueueulong inodeulong rxBytesulong txBytesulong rxPacketsulong txPacketsConnection state snapshot for bandwidth tracking.
Stores a point-in-time snapshot of a connection's statistics for calculating bandwidth over time.
Historical bandwidth data for a connection.
Tracks bandwidth samples over time for analysis.
Network protocol types for connection classification.
This enum represents common application-layer protocols that can be detected through heuristic analysis of port numbers and connection patterns.
HTTP connection information.
This struct extends NetConnection with HTTP-specific details extracted from the connection state. Due to the stateless nature of monitoring, some fields may not be available for all connections.
Example:
auto httpConns = httpConnections();
foreach (conn; httpConns) {
writeln(conn.host, " ", conn.method, " ", conn.statusCode);
}Functions 8
string generateConnectionId(NetConnection conn) @safe pureGenerates a unique identifier for a connection.SocketStats[] readSocketStatsLinux(ulong inode = 0) @trustedReads socket statistics from /proc/net/tcp (Linux only).ConnectionBandwidth[] connectionBandwidth(Duration window = Duration.zero) @systemGets bandwidth information for all active network connections.ConnectionStateSnapshot[] takeSnapshot(NetConnection[] connections) @safeTakes a snapshot of current connection states.ConnectionHistory[] getConnectionHistory(Duration window = Duration.zero) @systemGets historical bandwidth data for active connections.Protocol detectProtocol(NetConnection conn) @safe pure nothrowDetects the application-layer protocol for a network connection.Variables 3
ConnectionStateSnapshot[] previousSnapshotsMonoTime lastSnapshotTimebool initialized