xosview  1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
  Fossies Dox: xosview-1.23.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

NetMeter Class Reference

#include <netmeter.h>

Inheritance diagram for NetMeter:
[legend]
Collaboration diagram for NetMeter:
[legend]

Public Member Functions

 NetMeter (XOSView *parent, double max)
 
 ~NetMeter (void)
 
const char * name (void) const
 
void checkevent (void)
 
void checkResources (void)
 
 NetMeter (XOSView *parent, float max)
 
 ~NetMeter (void)
 
const char * name (void) const
 
void checkevent (void)
 
void checkResources (void)
 
 NetMeter (XOSView *parent, kstat_ctl_t *kc, float max)
 
 ~NetMeter (void)
 
const char * name (void) const
 
void checkevent (void)
 
void checkResources (void)
 
- Public Member Functions inherited from FieldMeterGraph
 FieldMeterGraph (XOSView *parent, int numfields, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~FieldMeterGraph (void)
 
virtual void drawfields (int mandatory=0)
 
- Public Member Functions inherited from FieldMeterDecay
 FieldMeterDecay (XOSView *parent, int numfields, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~FieldMeterDecay (void)
 
- Public Member Functions inherited from FieldMeter
 FieldMeter (XOSView *parent, int numfields, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~FieldMeter (void)
 
void setfieldcolor (int field, const char *color)
 
void setfieldcolor (int field, unsigned long color)
 
void docaptions (int val)
 
void dolegends (int val)
 
void dousedlegends (int val)
 
void reset (void)
 
void setUsed (double val, double total)
 
void draw (void)
 
void disableMeter (void)
 
- Public Member Functions inherited from Meter
 Meter (XOSView *parent, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0)
 
virtual ~Meter (void)
 
void resize (int x, int y, int width, int height)
 
void title (const char *title)
 
const char * title (void)
 
void legend (const char *legend)
 
const char * legend (void)
 
void docaptions (int val)
 
void dolegends (int val)
 
void dousedlegends (int val)
 
int requestevent (void)
 
int getX () const
 
int getY () const
 
int getWidth () const
 
int getHeight () const
 

Protected Member Functions

void getstats (void)
 
void getnetstats (void)
 
- Protected Member Functions inherited from FieldMeterGraph
void setNumCols (int n)
 
- Protected Member Functions inherited from FieldMeter
void SetUsedFormat (const char *const str)
 
void drawlegend (void)
 
void drawused (int mandatory)
 
bool checkX (int x, int width) const
 
void setNumFields (int n)
 
void IntervalTimerStart ()
 
void IntervalTimerStop ()
 
double IntervalTimeInMicrosecs ()
 
double IntervalTimeInSecs ()
 
- Protected Member Functions inherited from Meter
double samplesPerSecond ()
 
double secondsPerSample ()
 

Private Member Functions

void getProcStats (unsigned long long &totin, unsigned long long &totout)
 
void getSysStats (unsigned long long &totin, unsigned long long &totout)
 

Private Attributes

uint64_t lastBytesIn_
 
uint64_t lastBytesOut_
 
double netBandwidth_
 
std::string netIface_
 
bool ignored_
 
float _maxpackets
 
std::string _netIface
 
bool _usesysfs
 
bool _ignored
 
unsigned long long _lastBytesIn
 
unsigned long long _lastBytesOut
 
uint64_t _lastBytesIn
 
uint64_t _lastBytesOut
 
kstat_ctl_t * _kc
 
KStatList_nets
 
struct lifreq _lfr
 
int _socket
 

Additional Inherited Members

- Static Public Member Functions inherited from Meter
static double scaleValue (double value, char *scale, bool metric)
 
- Protected Types inherited from FieldMeter
enum  UsedType {
  INVALID_0 , FLOAT , PERCENT , AUTOSCALE ,
  INVALID_TAIL
}
 
- Protected Attributes inherited from FieldMeterGraph
int useGraph_
 
int graphNumCols_
 
int graphpos_
 
double * heightfield_
 
- Protected Attributes inherited from FieldMeterDecay
int dodecay_
 
int firsttime_
 
double * decay_
 
double * lastDecayval_
 
- Protected Attributes inherited from FieldMeter
int numfields_
 
double * fields_
 
double total_
 
double used_
 
double lastused_
 
int * lastvals_
 
int * lastx_
 
unsigned long * colors_
 
unsigned long usedcolor_
 
UsedType print_
 
int printedZeroTotalMesg_
 
int numWarnings_
 
bool metric_
 
int usedoffset_
 
- Protected Attributes inherited from Meter
XOSViewparent_
 
int x_
 
int y_
 
int width_
 
int height_
 
int docaptions_
 
int dolegends_
 
int dousedlegends_
 
int priority_
 
int counter_
 
char * title_
 
char * legend_
 
unsigned long textcolor_
 

Detailed Description

Definition at line 24 of file netmeter.h.

Constructor & Destructor Documentation

◆ NetMeter() [1/3]

◆ ~NetMeter() [1/3]

NetMeter::~NetMeter ( void  )

Definition at line 39 of file netmeter.cc.

◆ NetMeter() [2/3]

NetMeter::NetMeter ( XOSView parent,
float  max 
)

Definition at line 51 of file netmeter.cc.

References _ignored, _lastBytesIn, _lastBytesOut, _maxpackets, _usesysfs, max, and SYSCLASSNET.

◆ ~NetMeter() [2/3]

NetMeter::~NetMeter ( void  )

◆ NetMeter() [3/3]

NetMeter::NetMeter ( XOSView parent,
kstat_ctl_t *  kc,
float  max 
)

◆ ~NetMeter() [3/3]

NetMeter::~NetMeter ( void  )

Member Function Documentation

◆ checkevent() [1/3]

void NetMeter::checkevent ( void  )
virtual

Implements Meter.

Definition at line 59 of file netmeter.cc.

References FieldMeterGraph::drawfields(), and getstats().

◆ checkevent() [2/3]

void NetMeter::checkevent ( void  )
virtual

Reimplemented from FieldMeter.

◆ checkevent() [3/3]

void NetMeter::checkevent ( void  )
virtual

Reimplemented from FieldMeter.

◆ checkResources() [1/3]

◆ checkResources() [2/3]

void NetMeter::checkResources ( void  )
virtual

Reimplemented from FieldMeterGraph.

◆ checkResources() [3/3]

void NetMeter::checkResources ( void  )
virtual

Reimplemented from FieldMeterGraph.

◆ getnetstats()

◆ getProcStats()

void NetMeter::getProcStats ( unsigned long long &  totin,
unsigned long long &  totout 
)
private

Definition at line 149 of file netmeter.cc.

References _ignored, _netIface, XWin::done(), Meter::parent_, PROCNETDEV, and XOSDEBUG.

◆ getstats()

◆ getSysStats()

void NetMeter::getSysStats ( unsigned long long &  totin,
unsigned long long &  totout 
)
private

Definition at line 119 of file netmeter.cc.

References _ignored, _netIface, XWin::done(), getCount(), Meter::parent_, and SYSCLASSNET.

◆ name() [1/3]

const char* NetMeter::name ( void  ) const
inlinevirtual

Reimplemented from Meter.

Definition at line 29 of file netmeter.h.

◆ name() [2/3]

const char* NetMeter::name ( void  ) const
inlinevirtual

Reimplemented from Meter.

Definition at line 20 of file netmeter.h.

◆ name() [3/3]

const char* NetMeter::name ( void  ) const
inlinevirtual

Reimplemented from Meter.

Definition at line 23 of file netmeter.h.

Member Data Documentation

◆ _ignored

bool NetMeter::_ignored
private

Definition at line 29 of file netmeter.h.

Referenced by getnetstats(), getProcStats(), getSysStats(), and NetMeter().

◆ _kc

kstat_ctl_t* NetMeter::_kc
private

Definition at line 33 of file netmeter.h.

Referenced by getnetstats(), and NetMeter().

◆ _lastBytesIn [1/2]

unsigned long long NetMeter::_lastBytesIn
private

Definition at line 30 of file netmeter.h.

Referenced by getnetstats(), and NetMeter().

◆ _lastBytesIn [2/2]

uint64_t NetMeter::_lastBytesIn
private

Definition at line 32 of file netmeter.h.

◆ _lastBytesOut [1/2]

unsigned long long NetMeter::_lastBytesOut
private

Definition at line 30 of file netmeter.h.

Referenced by getnetstats(), and NetMeter().

◆ _lastBytesOut [2/2]

uint64_t NetMeter::_lastBytesOut
private

Definition at line 32 of file netmeter.h.

◆ _lfr

struct lifreq NetMeter::_lfr
private

Definition at line 36 of file netmeter.h.

Referenced by getnetstats().

◆ _maxpackets

float NetMeter::_maxpackets
private

Definition at line 27 of file netmeter.h.

Referenced by getnetstats(), and NetMeter().

◆ _netIface

std::string NetMeter::_netIface
private

Definition at line 28 of file netmeter.h.

Referenced by getnetstats(), getProcStats(), and getSysStats().

◆ _nets

KStatList* NetMeter::_nets
private

Definition at line 34 of file netmeter.h.

Referenced by getnetstats(), and NetMeter().

◆ _socket

int NetMeter::_socket
private

Definition at line 38 of file netmeter.h.

Referenced by getnetstats(), and NetMeter().

◆ _usesysfs

bool NetMeter::_usesysfs
private

Definition at line 29 of file netmeter.h.

Referenced by NetMeter().

◆ ignored_

bool NetMeter::ignored_
private

Definition at line 40 of file netmeter.h.

Referenced by checkResources(), getstats(), and NetMeter().

◆ lastBytesIn_

uint64_t NetMeter::lastBytesIn_
private

Definition at line 37 of file netmeter.h.

Referenced by getstats(), and NetMeter().

◆ lastBytesOut_

uint64_t NetMeter::lastBytesOut_
private

Definition at line 37 of file netmeter.h.

Referenced by getstats(), and NetMeter().

◆ netBandwidth_

double NetMeter::netBandwidth_
private

Definition at line 38 of file netmeter.h.

Referenced by getstats(), and NetMeter().

◆ netIface_

std::string NetMeter::netIface_
private

Definition at line 39 of file netmeter.h.

Referenced by checkResources(), getstats(), and NetMeter().


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