Skip to content

Commit

Permalink
Merge pull request #659 from britto/improve-metrics-setup-and-docs
Browse files Browse the repository at this point in the history
Improve metrics setup and docs
  • Loading branch information
benoitc authored Dec 8, 2020
2 parents 8a1f437 + 91ce456 commit a5be812
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 47 deletions.
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 @@ -598,15 +598,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

0 comments on commit a5be812

Please sign in to comment.