Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 28 lines (20 sloc) 0.632 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
<?php

require_once('./eval_conf.php');
require_once('./functions.php');

// Load the metric caching code
//$debug = 1;
retrieve_metrics_cache();

if ( isset($_GET['term']) && $_GET['term'] != "" ) {

  $query = $_GET['term'];
  // Now let's look through metrics.
  foreach ( $index_array['metrics'] as $metric_name => $hosts ) {
    if ( preg_match("/$query/i", $metric_name ) ) {
      foreach ( $hosts as $key => $host_name ) {
$cluster_name = $index_array['cluster'][$host_name];

$results[] = array( "value" => $cluster_name . "_|_" . $host_name . "_|_" . $metric_name);
      }
    }
  }

}

echo json_encode($results);

?>
Something went wrong with that request. Please try again.