Skip to content

Improve metrics setup and docs #659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,24 +517,26 @@ 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

|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_counter|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

Expand Down
32 changes: 17 additions & 15 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,24 +517,26 @@ 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

|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_counter|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

Expand Down
32 changes: 17 additions & 15 deletions doc/overview.edoc
Original file line number Diff line number Diff line change
Expand Up @@ -512,24 +512,26 @@ 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

|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_counter|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

Expand Down
4 changes: 2 additions & 2 deletions src/hackney_pool.erl
Original file line number Diff line number Diff line change
Expand Up @@ -639,15 +639,15 @@ 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) ->
_ = metrics:delete(Engine, [hackney_pool, PoolName, take_rate]),
_ = 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.


Expand Down