Skip to content

Commit a5be812

Browse files
authored
Merge pull request #659 from britto/improve-metrics-setup-and-docs
Improve metrics setup and docs
2 parents 8a1f437 + 91ce456 commit a5be812

File tree

4 files changed

+53
-47
lines changed

4 files changed

+53
-47
lines changed

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -517,24 +517,26 @@ been started.
517517

518518
#### Metrics per Hosts
519519

520-
|Name |Type | Description |
521-
|----------------------------|---------|----------------------------|
522-
|hackney.HOST.nb_requests |counter | Number of running requests |
523-
|hackney.HOST.request_time |histogram| Request time |
524-
|hackney.HOST.connect_time |histogram| Connect time |
525-
|hackney.HOST.response_time |histogram| Response time |
526-
|hackney.HOST.connect_timeout|counter | Number of connect timeout |
527-
|hackney.HOST.connect_error |counter | Number of timeout errors |
520+
|Name |Type | Description |
521+
|----------------------------------|---------|-------------------------------------------|
522+
|hackney.HOST.nb_requests |counter | Number of running requests |
523+
|hackney.HOST.request_time |histogram| Request time |
524+
|hackney.HOST.connect_time |histogram| Connect time |
525+
|hackney.HOST.response_time |histogram| Response time |
526+
|hackney.HOST.connect_timeout |counter | Number of connect timeout |
527+
|hackney.HOST.connect_error |counter | Number of timeout errors |
528+
|hackney_pool.HOST.new_connection |counter | Number of new pool connections per host |
529+
|hackney_pool.HOST.reuse_connection|counter | Number of reused pool connections per host|
528530

529531
#### Metrics per Pool
530532

531-
|Name |Type | Description |
532-
|------------------------------|-----------|--------------------------------------------------------------------|
533-
|hackney.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool|
534-
|hackney.POOLNAME.no_socket |counter | Count of new connections |
535-
|hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used |
536-
|hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool |
537-
|hackney.POOLNAME.queue_counter|histogram| queued clients |
533+
|Name |Type | Description |
534+
|----------------------------------|---------|----------------------------------------------------------------------|
535+
|hackney_pool.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool|
536+
|hackney_pool.POOLNAME.no_socket |counter | Count of new connections |
537+
|hackney_pool.POOLNAME.in_use_count|histogram| How many connections from the pool are used |
538+
|hackney_pool.POOLNAME.free_count |histogram| Number of free sockets in the pool |
539+
|hackney_pool.POOLNAME.queue_count |histogram| queued clients |
538540

539541
## Contribute
540542

doc/README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -517,24 +517,26 @@ been started.
517517

518518
#### Metrics per Hosts
519519

520-
|Name |Type | Description |
521-
|----------------------------|---------|----------------------------|
522-
|hackney.HOST.nb_requests |counter | Number of running requests |
523-
|hackney.HOST.request_time |histogram| Request time |
524-
|hackney.HOST.connect_time |histogram| Connect time |
525-
|hackney.HOST.response_time |histogram| Response time |
526-
|hackney.HOST.connect_timeout|counter | Number of connect timeout |
527-
|hackney.HOST.connect_error |counter | Number of timeout errors |
520+
|Name |Type | Description |
521+
|----------------------------------|---------|-------------------------------------------|
522+
|hackney.HOST.nb_requests |counter | Number of running requests |
523+
|hackney.HOST.request_time |histogram| Request time |
524+
|hackney.HOST.connect_time |histogram| Connect time |
525+
|hackney.HOST.response_time |histogram| Response time |
526+
|hackney.HOST.connect_timeout |counter | Number of connect timeout |
527+
|hackney.HOST.connect_error |counter | Number of timeout errors |
528+
|hackney_pool.HOST.new_connection |counter | Number of new pool connections per host |
529+
|hackney_pool.HOST.reuse_connection|counter | Number of reused pool connections per host|
528530

529531
#### Metrics per Pool
530532

531-
|Name |Type | Description |
532-
|------------------------------|-----------|--------------------------------------------------------------------|
533-
|hackney.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool|
534-
|hackney.POOLNAME.no_socket |counter | Count of new connections |
535-
|hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used |
536-
|hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool |
537-
|hackney.POOLNAME.queue_counter|histogram| queued clients |
533+
|Name |Type | Description |
534+
|----------------------------------|---------|----------------------------------------------------------------------|
535+
|hackney_pool.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool|
536+
|hackney_pool.POOLNAME.no_socket |counter | Count of new connections |
537+
|hackney_pool.POOLNAME.in_use_count|histogram| How many connections from the pool are used |
538+
|hackney_pool.POOLNAME.free_count |histogram| Number of free sockets in the pool |
539+
|hackney_pool.POOLNAME.queue_count |histogram| queued clients |
538540

539541
## Contribute
540542

doc/overview.edoc

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -512,24 +512,26 @@ been started.
512512

513513
#### Metrics per Hosts
514514

515-
|Name |Type | Description |
516-
|----------------------------|---------|----------------------------|
517-
|hackney.HOST.nb_requests |counter | Number of running requests |
518-
|hackney.HOST.request_time |histogram| Request time |
519-
|hackney.HOST.connect_time |histogram| Connect time |
520-
|hackney.HOST.response_time |histogram| Response time |
521-
|hackney.HOST.connect_timeout|counter | Number of connect timeout |
522-
|hackney.HOST.connect_error |counter | Number of timeout errors |
515+
|Name |Type | Description |
516+
|----------------------------------|---------|-------------------------------------------|
517+
|hackney.HOST.nb_requests |counter | Number of running requests |
518+
|hackney.HOST.request_time |histogram| Request time |
519+
|hackney.HOST.connect_time |histogram| Connect time |
520+
|hackney.HOST.response_time |histogram| Response time |
521+
|hackney.HOST.connect_timeout |counter | Number of connect timeout |
522+
|hackney.HOST.connect_error |counter | Number of timeout errors |
523+
|hackney_pool.HOST.new_connection |counter | Number of new pool connections per host |
524+
|hackney_pool.HOST.reuse_connection|counter | Number of reused pool connections per host|
523525

524526
#### Metrics per Pool
525527

526-
|Name |Type | Description |
527-
|------------------------------|-----------|--------------------------------------------------------------------|
528-
|hackney.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool|
529-
|hackney.POOLNAME.no_socket |counter | Count of new connections |
530-
|hackney.POOLNAME.in_use_count |histogram| How many connections from the pool are used |
531-
|hackney.POOLNAME.free_count |histogram| Number of free sockets in the pool |
532-
|hackney.POOLNAME.queue_counter|histogram| queued clients |
528+
|Name |Type | Description |
529+
|----------------------------------|---------|----------------------------------------------------------------------|
530+
|hackney_pool.POOLNAME.take_rate |meter | meter recording rate at which a connection is retrieved from the pool|
531+
|hackney_pool.POOLNAME.no_socket |counter | Count of new connections |
532+
|hackney_pool.POOLNAME.in_use_count|histogram| How many connections from the pool are used |
533+
|hackney_pool.POOLNAME.free_count |histogram| Number of free sockets in the pool |
534+
|hackney_pool.POOLNAME.queue_count |histogram| queued clients |
533535

534536
## Contribute
535537

src/hackney_pool.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,15 +598,15 @@ init_metrics(PoolName) ->
598598
_ = metrics:new(Engine, counter, [hackney_pool, PoolName, no_socket]),
599599
_ = metrics:new(Engine, histogram, [hackney_pool, PoolName, in_use_count]),
600600
_ = metrics:new(Engine, histogram, [hackney_pool, PoolName, free_count]),
601-
_ = metrics:new(Engine, histogram, [hackney_pool, PoolName, queue_counter]),
601+
_ = metrics:new(Engine, histogram, [hackney_pool, PoolName, queue_count]),
602602
Engine.
603603

604604
delete_metrics(Engine, PoolName) ->
605605
_ = metrics:delete(Engine, [hackney_pool, PoolName, take_rate]),
606606
_ = metrics:delete(Engine, [hackney_pool, PoolName, no_socket]),
607607
_ = metrics:delete(Engine, [hackney_pool, PoolName, in_use_count]),
608608
_ = metrics:delete(Engine, [hackney_pool, PoolName, free_count]),
609-
_ = metrics:delete(Engine, [hackney_pool, PoolName, queue_counter]),
609+
_ = metrics:delete(Engine, [hackney_pool, PoolName, queue_count]),
610610
ok.
611611

612612

0 commit comments

Comments
 (0)