Skip to content

Commit

Permalink
Make graphite collector accept floats
Browse files Browse the repository at this point in the history
  • Loading branch information
tucksaun authored and lyrixx committed Feb 20, 2015
1 parent 6f7faf8 commit e1795ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Beberlei/Metrics/Collector/Graphite.php
Expand Up @@ -103,6 +103,11 @@ public function flush()

public function push($stat, $value, $time = null)
{
$this->data[] = sprintf("%s %d %d\n", $stat, $value, $time ?: time());
$this->data[] = sprintf(
is_float($value) ? "%s %.18f %d\n" : "%s %d %d\n",
$stat,
$value,
$time ?: time()
);
}
}

0 comments on commit e1795ff

Please sign in to comment.