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

Submitted by Frediano Ziglio on Dec. 6, 2016, 12:55 p.m.

Details

Message ID 20161206125508.16715-3-fziglio@redhat.com
State Superseded
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 6, 2016, 12:55 p.m.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/red-channel.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

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);
 }