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

#include <socketengine.h>

Public Member Functions

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

Public Attributes

unsigned long TotalEvents
 
unsigned long ReadEvents
 
unsigned long WriteEvents
 
unsigned long ErrorEvents
 

Detailed Description

Socket engine statistics: count of various events, bandwidth usage

Constructor & Destructor Documentation

◆ Statistics()

SocketEngine::Statistics::Statistics ( )
inline

Constructor, initializes member vars except indata and outdata because those are set to 0 in CheckFlush() the first time Update() or GetBandwidth() is called.

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 ( int  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 ( int  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: