-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
At the moment metrics can only be formatted using Intl.NumberFormat. This falls short when displaying for example durations. Is it possible to add a human readable display (string) version that is used for non-graphs?
For example:
$this->registerMetric(new ReportMetric(
self::METRIC_ENTRY_DURATION,
'TIMESTAMPDIFF(MINUTE, start_time, end_time)',
'Recorded Entry Duration',
ReportMetric::AGGREGATE_SUM,
null, // Intl.NumberFormat would normally go here
function ($value) {
$totalMinutes = $value;
$hours = intdiv($totalMinutes, 60);
$minutes = $totalMinutes % 60;
return sprintf('%d:%dh', $hours, $minutes);
}
));(I am aware that TIMESTAMPDIFF does currently not work. See #5924 and #5966)
Metadata
Metadata
Assignees
Labels
No labels