Skip to content
Snippets Groups Projects
Commit 6fd94e29 authored by EvgenyMekhanik's avatar EvgenyMekhanik Committed by Kirill Yukhin
Browse files

iproto: implement getting network statistic per thread

Currently getting iproto statistics per thread is possible only
in debug mode, using `ERRINJ_IPROTO_SINGLE_THREAD_STAT` (it can be
used only in tests). This way have several disadvantages: first of
all `errinj` is not a place to get statistics, secondly user may be
interested in getting iproto statistics per thread. In this patch
`box.stat.net.thread` was implemented, it can be used for getting
same statistics as from `box.stat.net` but per thread.

Part of #6293

@TarantoolBot document
Title: getting network statistic per thread was implemented
User has possibility to run several iproto threads, but at the moment
he can get only general statistics, which combines statistics for all
threads. Now `box.stat.net.thread` has been implemented to get the same
statistics as when using `box.stat.net`, but for a thread. User can call
`box.stat.net.thread()` as a function to get general network statistics
per threads. For example for two iproto threads:
---
- - SENT:
      total: 0
      rps: 0
    CONNECTIONS:
      current: 0
      rps: 0
      total: 0
    REQUESTS:
      current: 0
      rps: 0
      total: 0
    RECEIVED:
      total: 0
      rps: 0
  - SENT:
      total: 0
      rps: 0
    CONNECTIONS:
      current: 0
      rps: 0
      total: 0
    REQUESTS:
      current: 0
      rps: 0
      total: 0
    RECEIVED:
      total: 0
      rps: 0
...

Also user can indexed it as a table by thread number. For example
`box.stat.net.thread[1]` returns network statistics for first iproto
thread:
---
- SENT:
    total: 0
    rps: 0
  CONNECTIONS:
    current: 0
    rps: 0
    total: 0
  REQUESTS:
    current: 0
    rps: 0
    total: 0
  RECEIVED:
    total: 0
    rps: 0
...
parent 10726acf
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment