[Spice-devel] [PATCH spice-server 3/3] Add message counters to statistics

Frediano Ziglio fziglio at redhat.com
Tue Dec 6 12:55:08 UTC 2016


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/red-channel.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/red-channel.c b/server/red-channel.c
index 03443ba..4a4f20c 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -103,6 +103,7 @@ struct RedChannelPrivate
     RedsState *reds;
     RedStatNode stat;
     RedStatCounter out_bytes_counter;
+    RedStatCounter out_messages;
 };
 
 enum {
@@ -414,6 +415,8 @@ void red_channel_init_stat_node(RedChannel *channel, const RedStatNode *parent,
     stat_init_node(&channel->priv->stat, channel->priv->reds, parent, name, TRUE);
     stat_init_counter(&channel->priv->out_bytes_counter,
                       channel->priv->reds, &channel->priv->stat, "out_bytes", TRUE);
+    stat_init_counter(&channel->priv->out_messages,
+                      channel->priv->reds, &channel->priv->stat, "out_messages", TRUE);
 }
 
 const RedStatNode *red_channel_get_stat_node(RedChannel *channel)
@@ -788,6 +791,7 @@ void red_channel_send_item(RedChannel *self, RedChannelClient *rcc, RedPipeItem
     RedChannelClass *klass = RED_CHANNEL_GET_CLASS(self);
     g_return_if_fail(klass->send_item);
 
+    stat_inc_counter(self->priv->out_messages, 1);
     klass->send_item(rcc, item);
 }
 
-- 
2.9.3



More information about the Spice-devel mailing list