metrics icon indicating copy to clipboard operation
metrics copied to clipboard

Timing documentation seems inconsistent

Open alexkokkinos opened this issue 6 years ago • 1 comments

It looks like the example documentation on how to use the timing functionality isn't consistent with the expected data type and unit of measure:

README.md:

$start = microtime(true);
$diff  = microtime(true) - $start;
$collector->timing('foo.bar', $diff);

In this example, $diff will be a float representing the time delta value in microseconds, while the interface expects an int representing milliseconds:

Collector.php:

    /**
     * Records a timing.
     *
     * @param string $variable
     * @param int    $time     The duration of the timing in milliseconds
     */
    public function timing($variable, $time);

alexkokkinos avatar Jan 21 '19 19:01 alexkokkinos

See https://github.com/beberlei/metrics/pull/71

alexkokkinos avatar Jan 21 '19 19:01 alexkokkinos