From 8a6e28e08ab24c207b10d83f79890542fd93dd9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Britto?= Date: Wed, 7 Oct 2020 16:57:57 -0300 Subject: [PATCH 1/3] Fix `queue_count` metric documentation and setup It was being initialized and deleted as `queue_counter` instead. --- README.md | 2 +- doc/README.md | 2 +- doc/overview.edoc | 2 +- src/hackney_pool.erl | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6b466000..188ced3a 100644 --- a/README.md +++ b/README.md @@ -534,7 +534,7 @@ been started. |hackney.POOLNAME.no_socket |counter | Count of new connections | |hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used | |hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool | -|hackney.POOLNAME.queue_counter|histogram| queued clients | +|hackney.POOLNAME.queue_count |histogram| queued clients | ## Contribute diff --git a/doc/README.md b/doc/README.md index 8e06a59a..0c050a5d 100644 --- a/doc/README.md +++ b/doc/README.md @@ -534,7 +534,7 @@ been started. |hackney.POOLNAME.no_socket |counter | Count of new connections | |hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used | |hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool | -|hackney.POOLNAME.queue_counter|histogram| queued clients | +|hackney.POOLNAME.queue_count |histogram| queued clients | ## Contribute diff --git a/doc/overview.edoc b/doc/overview.edoc index 9a950d48..8b92fff9 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -529,7 +529,7 @@ been started. |hackney.POOLNAME.no_socket |counter | Count of new connections | |hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used | |hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool | -|hackney.POOLNAME.queue_counter|histogram| queued clients | +|hackney.POOLNAME.queue_count |histogram| queued clients | ## Contribute diff --git a/src/hackney_pool.erl b/src/hackney_pool.erl index 2197cef6..ab92de6d 100644 --- a/src/hackney_pool.erl +++ b/src/hackney_pool.erl @@ -639,7 +639,7 @@ init_metrics(PoolName) -> _ = metrics:new(Engine, counter, [hackney_pool, PoolName, no_socket]), _ = metrics:new(Engine, histogram, [hackney_pool, PoolName, in_use_count]), _ = metrics:new(Engine, histogram, [hackney_pool, PoolName, free_count]), - _ = metrics:new(Engine, histogram, [hackney_pool, PoolName, queue_counter]), + _ = metrics:new(Engine, histogram, [hackney_pool, PoolName, queue_count]), Engine. delete_metrics(Engine, PoolName) -> @@ -647,7 +647,7 @@ delete_metrics(Engine, PoolName) -> _ = metrics:delete(Engine, [hackney_pool, PoolName, no_socket]), _ = metrics:delete(Engine, [hackney_pool, PoolName, in_use_count]), _ = metrics:delete(Engine, [hackney_pool, PoolName, free_count]), - _ = metrics:delete(Engine, [hackney_pool, PoolName, queue_counter]), + _ = metrics:delete(Engine, [hackney_pool, PoolName, queue_count]), ok. From 54b601764b2469aebe49d0de5d88d900d65abd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Britto?= Date: Wed, 7 Oct 2020 17:33:37 -0300 Subject: [PATCH 2/3] Fix documentation of pool metric names Their declared prefix is `hackney_pool`, not `hackney`. --- README.md | 14 +++++++------- doc/README.md | 14 +++++++------- doc/overview.edoc | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 188ced3a..a89509d5 100644 --- a/README.md +++ b/README.md @@ -528,13 +528,13 @@ been started. #### Metrics per Pool -|Name |Type | Description | -|------------------------------|-----------|--------------------------------------------------------------------| -|hackney.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool| -|hackney.POOLNAME.no_socket |counter | Count of new connections | -|hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used | -|hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool | -|hackney.POOLNAME.queue_count |histogram| queued clients | +|Name |Type | Description | +|----------------------------------|---------|----------------------------------------------------------------------| +|hackney_pool.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool| +|hackney_pool.POOLNAME.no_socket |counter | Count of new connections | +|hackney_pool.POOLNAME.in_use_count|histogram| How many connections from the pool are used | +|hackney_pool.POOLNAME.free_count |histogram| Number of free sockets in the pool | +|hackney_pool.POOLNAME.queue_count |histogram| queued clients | ## Contribute diff --git a/doc/README.md b/doc/README.md index 0c050a5d..daac6b39 100644 --- a/doc/README.md +++ b/doc/README.md @@ -528,13 +528,13 @@ been started. #### Metrics per Pool -|Name |Type | Description | -|------------------------------|-----------|--------------------------------------------------------------------| -|hackney.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool| -|hackney.POOLNAME.no_socket |counter | Count of new connections | -|hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used | -|hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool | -|hackney.POOLNAME.queue_count |histogram| queued clients | +|Name |Type | Description | +|----------------------------------|---------|----------------------------------------------------------------------| +|hackney_pool.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool| +|hackney_pool.POOLNAME.no_socket |counter | Count of new connections | +|hackney_pool.POOLNAME.in_use_count|histogram| How many connections from the pool are used | +|hackney_pool.POOLNAME.free_count |histogram| Number of free sockets in the pool | +|hackney_pool.POOLNAME.queue_count |histogram| queued clients | ## Contribute diff --git a/doc/overview.edoc b/doc/overview.edoc index 8b92fff9..f884a12f 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -523,13 +523,13 @@ been started. #### Metrics per Pool -|Name |Type | Description | -|------------------------------|-----------|--------------------------------------------------------------------| -|hackney.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool| -|hackney.POOLNAME.no_socket |counter | Count of new connections | -|hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used | -|hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool | -|hackney.POOLNAME.queue_count |histogram| queued clients | +|Name |Type | Description | +|----------------------------------|---------|----------------------------------------------------------------------| +|hackney_pool.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool| +|hackney_pool.POOLNAME.no_socket |counter | Count of new connections | +|hackney_pool.POOLNAME.in_use_count|histogram| How many connections from the pool are used | +|hackney_pool.POOLNAME.free_count |histogram| Number of free sockets in the pool | +|hackney_pool.POOLNAME.queue_count |histogram| queued clients | ## Contribute From 91ce456916549813f4b6bf35da7861d0586dd6cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Britto?= Date: Wed, 7 Oct 2020 19:18:29 -0300 Subject: [PATCH 3/3] Add missing documentation for host-based pool metrics * hackney_pool.HOST.new_connection * hackney_pool.HOST.reuse_connection --- README.md | 18 ++++++++++-------- doc/README.md | 18 ++++++++++-------- doc/overview.edoc | 18 ++++++++++-------- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index a89509d5..24f54b2d 100644 --- a/README.md +++ b/README.md @@ -517,14 +517,16 @@ been started. #### Metrics per Hosts -|Name |Type | Description | -|----------------------------|---------|----------------------------| -|hackney.HOST.nb_requests |counter | Number of running requests | -|hackney.HOST.request_time |histogram| Request time | -|hackney.HOST.connect_time |histogram| Connect time | -|hackney.HOST.response_time |histogram| Response time | -|hackney.HOST.connect_timeout|counter | Number of connect timeout | -|hackney.HOST.connect_error |counter | Number of timeout errors | +|Name |Type | Description | +|----------------------------------|---------|-------------------------------------------| +|hackney.HOST.nb_requests |counter | Number of running requests | +|hackney.HOST.request_time |histogram| Request time | +|hackney.HOST.connect_time |histogram| Connect time | +|hackney.HOST.response_time |histogram| Response time | +|hackney.HOST.connect_timeout |counter | Number of connect timeout | +|hackney.HOST.connect_error |counter | Number of timeout errors | +|hackney_pool.HOST.new_connection |counter | Number of new pool connections per host | +|hackney_pool.HOST.reuse_connection|counter | Number of reused pool connections per host| #### Metrics per Pool diff --git a/doc/README.md b/doc/README.md index daac6b39..a62da807 100644 --- a/doc/README.md +++ b/doc/README.md @@ -517,14 +517,16 @@ been started. #### Metrics per Hosts -|Name |Type | Description | -|----------------------------|---------|----------------------------| -|hackney.HOST.nb_requests |counter | Number of running requests | -|hackney.HOST.request_time |histogram| Request time | -|hackney.HOST.connect_time |histogram| Connect time | -|hackney.HOST.response_time |histogram| Response time | -|hackney.HOST.connect_timeout|counter | Number of connect timeout | -|hackney.HOST.connect_error |counter | Number of timeout errors | +|Name |Type | Description | +|----------------------------------|---------|-------------------------------------------| +|hackney.HOST.nb_requests |counter | Number of running requests | +|hackney.HOST.request_time |histogram| Request time | +|hackney.HOST.connect_time |histogram| Connect time | +|hackney.HOST.response_time |histogram| Response time | +|hackney.HOST.connect_timeout |counter | Number of connect timeout | +|hackney.HOST.connect_error |counter | Number of timeout errors | +|hackney_pool.HOST.new_connection |counter | Number of new pool connections per host | +|hackney_pool.HOST.reuse_connection|counter | Number of reused pool connections per host| #### Metrics per Pool diff --git a/doc/overview.edoc b/doc/overview.edoc index f884a12f..5f9cd177 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -512,14 +512,16 @@ been started. #### Metrics per Hosts -|Name |Type | Description | -|----------------------------|---------|----------------------------| -|hackney.HOST.nb_requests |counter | Number of running requests | -|hackney.HOST.request_time |histogram| Request time | -|hackney.HOST.connect_time |histogram| Connect time | -|hackney.HOST.response_time |histogram| Response time | -|hackney.HOST.connect_timeout|counter | Number of connect timeout | -|hackney.HOST.connect_error |counter | Number of timeout errors | +|Name |Type | Description | +|----------------------------------|---------|-------------------------------------------| +|hackney.HOST.nb_requests |counter | Number of running requests | +|hackney.HOST.request_time |histogram| Request time | +|hackney.HOST.connect_time |histogram| Connect time | +|hackney.HOST.response_time |histogram| Response time | +|hackney.HOST.connect_timeout |counter | Number of connect timeout | +|hackney.HOST.connect_error |counter | Number of timeout errors | +|hackney_pool.HOST.new_connection |counter | Number of new pool connections per host | +|hackney_pool.HOST.reuse_connection|counter | Number of reused pool connections per host| #### Metrics per Pool