Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Ilya Kosarev <i.kosarev@tarantool.org>
Cc: tarantool-patches@freelists.org, georgy@tarantool.org,
	i.kosarev@corp.mail.ru, Ilya Kosarev <ilyanapar@yandex.ru>
Subject: Re: [PATCH v2] iproto: report active connections number
Date: Tue, 26 Feb 2019 11:18:45 +0300	[thread overview]
Message-ID: <20190226081845.jq3mhuruvoerohtt@esperanza> (raw)
In-Reply-To: <20190225223607.21729-1-i.kosarev@tarantool.org>

On Tue, Feb 26, 2019 at 01:36:07AM +0300, Ilya Kosarev wrote:
> diff --git a/src/box/iproto.cc b/src/box/iproto.cc
> index 863eb4f06..386bab239 100644
> --- a/src/box/iproto.cc
> +++ b/src/box/iproto.cc
> @@ -263,14 +263,20 @@ static struct cord net_cord;
>  static struct slab_cache net_slabc;
>  
>  struct rmean *rmean_net;
> +struct rmean *rmean_connections;
>  
>  enum rmean_net_name {
>  	IPROTO_SENT,
>  	IPROTO_RECEIVED,
>  	IPROTO_LAST,
>  };
> +enum rmean_connection_name {
> +    IPROTO_CONNECTIONS,
> +    IPROTO_CONNECTIONS_LAST,
> +};

Why do you use rmean for this at all? You don't need to account RPS,
do you?

I think you don't even need to introduce a new counter - instead you
can simply use mempool_count(iproto_connection_pool).

> diff --git a/test/box/stat_net.result b/test/box/stat_net.result
> index b3e3db11f..dad932f8c 100644
> --- a/test/box/stat_net.result
> +++ b/test/box/stat_net.result
> @@ -46,8 +58,35 @@ box.stat.net.RECEIVED.total > 0
>  ---
>  - true
>  ...
> +box.stat.net.CONNECTIONS.total == 4
> +---
> +- true
> +...
>  -- box.stat.net.EVENTS.total > 0
>  -- box.stat.net.LOCKS.total > 0
> +cn1:close()
> +---
> +...
> +cn2:close()
> +---
> +...
> +fiber.sleep(0.001)

What's fiber.sleep for? If there's a delay after close() you should use
test_run.wait_cond() to exclude any possibility of a race.

> +---
> +...
> +box.stat.net.CONNECTIONS.total == 2
> +---
> +- true
> +...

      reply	other threads:[~2019-02-26  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25 22:36 Ilya Kosarev
2019-02-26  8:18 ` Vladimir Davydov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190226081845.jq3mhuruvoerohtt@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=georgy@tarantool.org \
    --cc=i.kosarev@corp.mail.ru \
    --cc=i.kosarev@tarantool.org \
    --cc=ilyanapar@yandex.ru \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [PATCH v2] iproto: report active connections number' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox