Changeset 1ff8feba541fcb92dc93174b0a3493fa113dab2b

Show
Ignore:
Timestamp:
06/19/09 20:07:13 (6 years ago)
Author:
Umar Farooq <umar@omniti.com>
git-committer:
Umar Farooq <umar@omniti.com> 1245442033 +0000
git-parent:

[1c94710a8ffc6521b5140ecdda68892fb4f9efad]

git-author:
Umar Farooq <umar@omniti.com> 1245442033 +0000
Message:

check if we have datasets in the graph before doing stuff like calculating percentiles, caused issues when we remove all datasets from a graph

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ui/web/lib/Reconnoiter_DB.php

    r1fa32a0 r1ff8feb  
    332332  } 
    333333  function percentile($arr, $p, $groupname = 'left', $attr = NULL) { 
     334 
    334335    // This sums the sets and returns the XX percentile bucket. 
    335     if(!is_array($arr)) return array(); 
     336    if(!is_array($arr) || !count($arr)) return array(); 
    336337    if(!is_array($p)) $p = array($p); 
    337338    $full = array(); 
  • ui/web/lib/Reconnoiter_flot_Driver.php

    r4555bbf r1ff8feb  
    8282    }//end if stacking 
    8383*/ 
     84 
     85  if(count($a)) {      
    8486    $start_ts = $a[0]['data'][0][0]; 
    8587    $finish = end($a[0]['data']); 
     
    9496      ); 
    9597    } 
     98  } 
    9699    return $a; 
    97100  }