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