Closed bracki closed 8 years ago
Great work! Noticed one issue though – It seems as if counters don't handle floats yet:
~/s/prometheus_client_php ❯❯❯ docker-compose up
~/s/prometheus_client_php ❯❯❯ curl 'localhost:8080/examples/some_counter.php?adapter=apc&c=2.2' OK
~/s/prometheus_client_php ❯❯❯ curl 'localhost:8080/examples/some_counter.php?adapter=apc&c=2.2' 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 4.4 I guess.
# HELP test_some_counter it increases
# TYPE test_some_counter counter
test_some_counter{type="blue"} 4.4
@tback Technically yes, the Redis implementation also only supports integers. I'd prefer if you opened another issue.
This PR enables to collect metrics w/o any external dependencies, just by relying on APCu. In order to get it to work with APC (which only allow for atomic operations to work on integers) we use the same technique as in the Golang client.