xosview
1.23
About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).
![]() ![]() |
#include <netmeter.h>
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) |
![]() | |
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) |
![]() | |
FieldMeterDecay (XOSView *parent, int numfields, const char *title="", const char *legend="", int docaptions=0, int dolegends=0, int dousedlegends=0) | |
virtual | ~FieldMeterDecay (void) |
![]() | |
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) |
![]() | |
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) |
![]() | |
void | setNumCols (int n) |
![]() | |
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 () |
![]() | |
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 double | scaleValue (double value, char *scale, bool metric) |
![]() | |
enum | UsedType { INVALID_0 , FLOAT , PERCENT , AUTOSCALE , INVALID_TAIL } |
![]() | |
int | useGraph_ |
int | graphNumCols_ |
int | graphpos_ |
double * | heightfield_ |
![]() | |
int | dodecay_ |
int | firsttime_ |
double * | decay_ |
double * | lastDecayval_ |
![]() | |
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_ |
![]() | |
XOSView * | parent_ |
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_ |
Definition at line 24 of file netmeter.h.
NetMeter::NetMeter | ( | XOSView * | parent, |
double | max | ||
) |
Definition at line 22 of file netmeter.cc.
References BSDGetNetInOut(), BSDNetInit(), FieldMeter::disableMeter(), ignored_, FieldMeter::IntervalTimerStart(), lastBytesIn_, lastBytesOut_, max, netBandwidth_, netIface_, and FieldMeter::total_.
NetMeter::~NetMeter | ( | void | ) |
Definition at line 39 of file netmeter.cc.
NetMeter::NetMeter | ( | XOSView * | parent, |
float | max | ||
) |
Definition at line 51 of file netmeter.cc.
References _ignored, _lastBytesIn, _lastBytesOut, _maxpackets, _usesysfs, max, and SYSCLASSNET.
NetMeter::~NetMeter | ( | void | ) |
NetMeter::NetMeter | ( | XOSView * | parent, |
kstat_ctl_t * | kc, | ||
float | max | ||
) |
Definition at line 20 of file netmeter.cc.
References _ignored, _kc, _lastBytesIn, _lastBytesOut, _maxpackets, _nets, _socket, XWin::done(), KStatList::getList(), max, KStatList::NETS, and Meter::parent_.
NetMeter::~NetMeter | ( | void | ) |
|
virtual |
Implements Meter.
Definition at line 59 of file netmeter.cc.
References FieldMeterGraph::drawfields(), and getstats().
|
virtual |
Reimplemented from FieldMeter.
|
virtual |
Reimplemented from FieldMeter.
|
virtual |
Reimplemented from FieldMeterGraph.
Definition at line 42 of file netmeter.cc.
References FieldMeterGraph::checkResources(), FieldMeterDecay::dodecay_, XWin::getResource(), ignored_, XWin::isResourceTrue(), netIface_, Meter::parent_, Meter::priority_, FieldMeter::setfieldcolor(), FieldMeter::SetUsedFormat(), and FieldMeterGraph::useGraph_.
|
virtual |
Reimplemented from FieldMeterGraph.
|
virtual |
Reimplemented from FieldMeterGraph.
|
protected |
Definition at line 60 of file netmeter.cc.
References _ignored, _kc, _lastBytesIn, _lastBytesOut, _lfr, _maxpackets, _netIface, _nets, _socket, KStatList::count(), FieldMeter::fields_, FieldMeter::IntervalTimeInSecs(), FieldMeter::IntervalTimerStart(), FieldMeter::IntervalTimerStop(), kstat_to_ui64(), FieldMeter::setUsed(), FieldMeter::total_, KStatList::update(), and XOSDEBUG.
|
private |
Definition at line 149 of file netmeter.cc.
References _ignored, _netIface, XWin::done(), Meter::parent_, PROCNETDEV, and XOSDEBUG.
|
protected |
Definition at line 64 of file netmeter.cc.
References BSDGetNetInOut(), FieldMeter::fields_, ignored_, FieldMeter::IntervalTimeInSecs(), FieldMeter::IntervalTimerStart(), FieldMeter::IntervalTimerStop(), lastBytesIn_, lastBytesOut_, netBandwidth_, netIface_, FieldMeter::setUsed(), and FieldMeter::total_.
Referenced by checkevent().
|
private |
Definition at line 119 of file netmeter.cc.
References _ignored, _netIface, XWin::done(), getCount(), Meter::parent_, and SYSCLASSNET.
|
inlinevirtual |
Reimplemented from Meter.
Definition at line 29 of file netmeter.h.
|
inlinevirtual |
Reimplemented from Meter.
Definition at line 20 of file netmeter.h.
|
inlinevirtual |
Reimplemented from Meter.
Definition at line 23 of file netmeter.h.
|
private |
Definition at line 29 of file netmeter.h.
Referenced by getnetstats(), getProcStats(), getSysStats(), and NetMeter().
|
private |
Definition at line 33 of file netmeter.h.
Referenced by getnetstats(), and NetMeter().
|
private |
Definition at line 30 of file netmeter.h.
Referenced by getnetstats(), and NetMeter().
|
private |
Definition at line 32 of file netmeter.h.
|
private |
Definition at line 30 of file netmeter.h.
Referenced by getnetstats(), and NetMeter().
|
private |
Definition at line 32 of file netmeter.h.
|
private |
Definition at line 36 of file netmeter.h.
Referenced by getnetstats().
|
private |
Definition at line 27 of file netmeter.h.
Referenced by getnetstats(), and NetMeter().
|
private |
Definition at line 28 of file netmeter.h.
Referenced by getnetstats(), getProcStats(), and getSysStats().
|
private |
Definition at line 34 of file netmeter.h.
Referenced by getnetstats(), and NetMeter().
|
private |
Definition at line 38 of file netmeter.h.
Referenced by getnetstats(), and NetMeter().
|
private |
Definition at line 29 of file netmeter.h.
Referenced by NetMeter().
|
private |
Definition at line 40 of file netmeter.h.
Referenced by checkResources(), getstats(), and NetMeter().
|
private |
Definition at line 37 of file netmeter.h.
Referenced by getstats(), and NetMeter().
|
private |
Definition at line 37 of file netmeter.h.
Referenced by getstats(), and NetMeter().
|
private |
Definition at line 38 of file netmeter.h.
Referenced by getstats(), and NetMeter().
|
private |
Definition at line 39 of file netmeter.h.
Referenced by checkResources(), getstats(), and NetMeter().