InspIRCd  4.0
Public Member Functions | Public Attributes | List of all members
SocketEngine::Statistics Class Reference

#include <socketengine.h>

Public Member Functions

void UpdateReadCounters (ssize_t len_in)
 
void UpdateWriteCounters (ssize_t len_out)
 
void GetBandwidth (float &kbitpersec_in, float &kbitpersec_out, float &kbitpersec_total) const
 

Public Attributes

unsigned long TotalEvents = 0
 
unsigned long ReadEvents = 0
 
unsigned long WriteEvents = 0
 
unsigned long ErrorEvents = 0
 

Detailed Description

Socket engine statistics: count of various events, bandwidth usage

Member Function Documentation

◆ GetBandwidth()

void SocketEngine::Statistics::GetBandwidth ( float &  kbitpersec_in,
float &  kbitpersec_out,
float &  kbitpersec_total 
) const

Get data transfer statistics.

Parameters
kbitpersec_inFilled with incoming traffic in this second in kbit/s.
kbitpersec_outFilled with outgoing traffic in this second in kbit/s.
kbitpersec_totalFilled with total traffic in this second in kbit/s.

◆ UpdateReadCounters()

void SocketEngine::Statistics::UpdateReadCounters ( ssize_t  len_in)

Update counters for network data received. This should be called after every read-type syscall.

Parameters
len_inNumber of bytes received, or -1 for error, as typically returned by a read-style syscall.

◆ UpdateWriteCounters()

void SocketEngine::Statistics::UpdateWriteCounters ( ssize_t  len_out)

Update counters for network data sent. This should be called after every write-type syscall.

Parameters
len_outNumber of bytes sent, or -1 for error, as typically returned by a read-style syscall.

The documentation for this class was generated from the following files: