You are here

function monitoring_value_types in Monitoring 7

Same name and namespace in other branches
  1. 8 monitoring.module \monitoring_value_types()

Gets available value types definitions.

Return value

array Value type definitions, consisting of a label and an optional formatter_callback.

3 calls to monitoring_value_types()
MonitoringApiTest::testAPI in test/tests/monitoring.api.test
Test the base class if info is set and passed correctly.
SensorInfo::getValueLabel in lib/Drupal/monitoring/Sensor/SensorInfo.php
Gets sensor value label.
SensorResult::getFormattedValue in lib/Drupal/monitoring/Result/SensorResult.php
Formats the value to be human readable.

File

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

Code

function monitoring_value_types() {

  // @todo Allow extension of those types throgh a hook or plugin system.
  return array(
    'time_interval' => array(
      'label' => 'Seconds',
      'formatter_callback' => 'monitoring_value_label_callback_interval',
    ),
    'bool' => array(
      'label' => 'Status',
      'formatter_callback' => 'monitoring_value_label_callback_bool',
    ),
    'commerce_currency' => array(
      'label' => 'Commerce currency',
      'formatter_callback' => 'monitoring_value_label_callback_commerce_currency',
    ),
  );
}