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
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
APC
The metric should read 5.4 I guess.