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

Frediano Ziglio fziglio at redhat.com
Mon Feb 20 14:13:03 UTC 2017


Didn't forget to merge this.

It's just that not every time you call send_item a message is sent
(just remembered before merging).

Frediano

> 
> Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
> 
> 
> On Tue, 2017-02-14 at 15:51 +0000, Frediano Ziglio wrote:
> > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > ---
> >  server/red-channel.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > Ping.
> > 
> > diff --git a/server/red-channel.c b/server/red-channel.c
> > index e70c46b..3599c3b 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)
> > @@ -782,6 +785,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);
> >  }
> >  
> 


More information about the Spice-devel mailing list