Re: [PATCH 2/3] device: add statistics interface



On Thu, Jun 23, 2016 at 03:25:24PM +0200, Alfonso Sanchez-Beato wrote:
--- /dev/null
+++ b/introspection/nm-device-statistics.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<node name="/">
+  <interface name="org.freedesktop.NetworkManager.Device.Statistics">
+
+    <!--
+        RefreshRateMs:
+
+        Rate of change of the rest of properties of this interface. If zero, the
+        properties do not change. Othewise, the properties are refreshed each

s/Othewise/Otherwise/

+        RefreshRateMs milliseconds in case the underlaying counter has changed
+        too.
+
+        Returns: Unsigned 32-bit integer

Properties don't need a Returns: line.

Can you please also add the new interface to
docs/api/{Makefile.am,network-manager-docs.xml} so that it gets
documented when NM is built with --enable-gtk-doc?

--- /dev/null
+++ b/src/devices/nm-device-statistics.c
+     _LOGD ("%s {newlink} index %d address %s mtu %u operstate %u <%s>",
+            ifname, index, hw_addr, mtu, operstate, operstate_to_str (operstate));
+     _LOGD ("%s {RX} %u packets %u bytes", ifname,
+            stats.rx_packets, stats.rx_bytes);
+     _LOGD ("%s {TX} %u packets %u bytes", ifname,
+            stats.tx_packets, stats.tx_bytes);

I think this is a bit too verbose for DEBUG... maybe use _LOGT instead
to log only at TRACE level? Or drop non-error messages altogether?

+     _LOGD ("Sending %s len %d type %d flags 0x%04x seq %d",
+            type_to_string (req.hdr.nlmsg_type),
+            req.hdr.nlmsg_len, req.hdr.nlmsg_type,
+            req.hdr.nlmsg_flags, req.hdr.nlmsg_seq);

The same here.

--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -11835,6 +11899,22 @@ set_property (GObject *object, guint prop_id,
                      priv->hw_addr = NULL;
              }
              break;
+     case PROP_REFRESH_RATE_MS:
+             refresh_rate_ms = g_value_get_uint (value);
+             if (priv->refresh_rate_ms == refresh_rate_ms)
+                     break;
+
+             priv->refresh_rate_ms = g_value_get_uint (value);

priv->refresh_rate_ms = refresh_rate_ms

Regards,
Beniamino

Attachment: signature.asc
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]