1 #include "ace/Monitor_Control/Bytes_Sent_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_Sent_Monitor::default_name_
=
12 "OS/Network/BytesSent";
14 Bytes_Sent_Monitor::Bytes_Sent_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 Sent/sec"))
19 #elif defined (ACE_LINUX)
20 , Linux_Network_Interface_Monitor (
21 " %*[^:]: %*u %*u %*u %*u %*u %*u %*u %*u %lu %*u")
22 /// Scan format for /proc/net/dev
23 #elif defined (__FreeBSD__) || defined (__Lynx__)
24 , FreeBSD_Network_Interface_Monitor (ACE_TEXT ("obytes"))
25 #elif defined (__NetBSD__) || defined (__OpenBSD__)
26 , BSD_Network_Interface_Monitor (ACE_TEXT ("obytes"))
31 Bytes_Sent_Monitor::update ()
35 /// On some platforms, value_ is an ACE_UINT64.
36 this->receive (static_cast<double> (this->value_
));
40 Bytes_Sent_Monitor::default_name ()
42 return Bytes_Sent_Monitor::default_name_
;
46 Bytes_Sent_Monitor::clear_i ()
49 this->Monitor_Base::clear_i ();
54 ACE_END_VERSIONED_NAMESPACE_DECL
56 #endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */