1 #include "ace/Monitor_Control/Bytes_Received_Monitor.h"
3 #if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)
5 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
9 namespace Monitor_Control
11 const char* Bytes_Received_Monitor::default_name_
=
12 "OS/Network/BytesReceived";
14 Bytes_Received_Monitor::Bytes_Received_Monitor (const char* name
)
15 : Monitor_Base (name
, Monitor_Control_Types::MC_NUMBER
)
16 #if defined (ACE_HAS_WIN32_PDH)
17 , Windows_Multi_Instance_Monitor (
18 ACE_TEXT ("\\Network Interface(*)\\Bytes Received/sec"))
19 #elif defined (ACE_LINUX)
20 , Linux_Network_Interface_Monitor (
21 " %*[^:]: %lu %*u %*u %*u %*u %*u %*u %*u %*u %*u")
22 /// Scan format for /proc/net/dev
23 #elif defined (__NetBSD__) || defined (__OpenBSD__)
24 , BSD_Network_Interface_Monitor (ACE_TEXT ("ibytes"))
25 #elif defined (__FreeBSD__) || defined (__Lynx__)
26 , FreeBSD_Network_Interface_Monitor (ACE_TEXT ("ibytes"))
31 Bytes_Received_Monitor::update ()
35 /// On some platforms, value_ is an ACE_UINT64.
36 this->receive (static_cast<double> (this->value_
));
40 Bytes_Received_Monitor::default_name ()
42 return Bytes_Received_Monitor::default_name_
;
46 Bytes_Received_Monitor::clear_i ()
49 this->Monitor_Base::clear_i ();
54 ACE_END_VERSIONED_NAMESPACE_DECL
56 #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */