You are here

function monitoring_value_label_callback_interval in Monitoring 8

Same name and namespace in other branches
  1. 7 monitoring.module \monitoring_value_label_callback_interval()

Formatter for time interval value.

Parameters

\Drupal\monitoring\Result\SensorResultInterface $result: Result object for which to get the formatted value.

Return value

string Formatted time interval.

See also

\Drupal::service('date.formatter')->formatInterval()

1 string reference to 'monitoring_value_label_callback_interval'
monitoring_value_types in ./monitoring.module
Gets available value types definitions.

File

./monitoring.module, line 432
Monitoring bootstrap file.

Code

function monitoring_value_label_callback_interval(SensorResultInterface $result) {
  return \Drupal::service('date.formatter')
    ->formatInterval($result
    ->getValue());
}