-//TopHat pairwise data
-
- $this->HopCount = "";
- $this->RTT = "";
-
- if ($this->reference_nodes != "")
- {
- //print_r($this->reference_nodes);
-
- $dd = array();
-
- if ($all_nodes) foreach ($all_nodes as $n)
- $dd[] = $n['hostname'];
-
- $st = time() + microtime();
- if ($this->headerIsVisible("HC"))
- {
- print("[NEW] Calling tophat api for HopCount with reference node = ".$this->reference_nodes['hopcount']);
- $this->HopCount = $this->getPairwise($this->reference_nodes['hopcount'], $dd, 'traceroute', 'hop_count');
- }
- else
-
- if ($this->headerIsVisible("RTT"))
- {
- print("[NEW] Calling tophat api for RTT with reference node = ".$this->reference_nodes['rtt']);
- $this->RTT = $this->getPairwise($this->reference_nodes['rtt'], $dd, 'rtt','rtt');
- }
-
- //printf(" (%.2f ms)<br/>", (time() + microtime()-$st)*100);
- print_r($this->HopCount);
- }
-}
-
-
-function excludeItems($value, $exclude_list, $hh) {
-
- if ($value == "")
- $value = "n/a";
-
- if ($exclude_list)
- if (in_array($value, $exclude_list))
- return array($value, array('name'=>$hh, 'display'=>'table-cell'));
- else
- return array($value, array('name'=>$hh, 'display'=>'table-cell'));
-
- return array($value, array('name'=>$hh, 'display'=>'table-cell'));
-}
-
-
-function checkThreshold($value, $threshold, $hh) {
-
- if ($value == "")
- return array("n/a", array('name'=>$hh, 'display'=>'table-cell'));
-
- if ($threshold)
- if ((float) $value >= (float) $threshold[0] && (float) $value <= (float) $threshold[1])
- return array(round($value,1), array('name'=>$hh, 'display'=>'table-cell'));
- else
- return array(round($value,1), array('name'=>$hh, 'display'=>'table-cell'));
-
- return array(round($value,1), array('name'=>$hh, 'display'=>'table-cell'));