Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Counters don't support float values #26

Open
tback opened this issue Sep 8, 2016 · 0 comments
Open

Counters don't support float values #26

tback opened this issue Sep 8, 2016 · 0 comments

Comments

@tback
Copy link

tback commented Sep 8, 2016

Great work! Noticed one issue though – It seems as if counters don't handle floats yet. The behavior of the redis adapter and the apc adapter differs: Redis completly ignores float values where apc counts their int values and discards the decimal:

Redis

~/s/prometheus_client_php ❯❯❯ docker-compose up -d
~ ❯❯❯ curl 'localhost:8080/examples/some_counter.php?adapter=redis&c=2.7'
OK
~ ❯❯❯ curl 'localhost:8080/examples/some_counter.php?adapter=redis&c=2.7'
OK
~ ❯❯❯ curl 'localhost:8080/examples/metrics.php?adapter=redis'

~ ❯❯❯

APC

~/s/prometheus_client_php ❯❯❯ docker-compose up -d
~/s/prometheus_client_php ❯❯❯ curl 'localhost:8080/examples/some_counter.php?adapter=apc&c=2.7'                                                        OK
~/s/prometheus_client_php ❯❯❯ curl 'localhost:8080/examples/some_counter.php?adapter=apc&c=2.7'                                                        OK
~/s/prometheus_client_php ❯❯❯ curl 'localhost:8080/examples/metrics.php?adapter=apc'                                                                   # HELP test_some_counter it increases
# TYPE test_some_counter counter
test_some_counter{type="blue"} 4

The metric should read 5.4 I guess.

# HELP test_some_counter it increases
# TYPE test_some_counter counter
test_some_counter{type="blue"} 5.4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant