Example #1
0
 static function fill_in_missing_snaps($to, $from, &$current_col = 0)
 {
     #
     # missing snaps?
     #
     $from_times = explode(':', $from);
     $to_times = explode(':', $to);
     $from_secs = $from_times[0] * 60 * 60 + $from_times[1] * 60 + $from_times[2];
     $to_secs = $to_times[0] * 60 * 60 + $to_times[1] * 60 + $to_times[2];
     for ($sec = $to_secs - 1; $sec > $from_secs; $sec--) {
         if ($current_col) {
             $current_col++;
             #
             # Minute exact
             #
             u::time_marker($sec, $current_col);
             #u::p("<div class=\"sess col$current_col\"></div>");
         } else {
             printf("<tr><td>%02s:%02s:%02s</td></tr>\n", floor($sec / 3600), floor($sec % 3600 / 60), $sec % 60);
         }
     }
 }
Example #2
0
}
#
# Move pos for next chart
#
$chart_top = $chart_top + $chart_height + 10;
$graph_heights = array();
$max_height_cells = 0;
while ($rec = oci_fetch_object($cur)) {
    $col++;
    u::fill_in_missing_snaps($last_snap_time, $rec->S_TIME, $col);
    $times = explode(':', $rec->S_TIME);
    $secs = $times[0] * 60 * 60 + $times[1] * 60 + $times[2];
    #
    # Date time in the graph, if needed
    #
    u::time_marker($secs, $col);
    $last_snap_time = $rec->S_TIME;
    #
    # Time markers take up first row
    #
    $current_row = 2;
    cells($rec->SIDS_ON_CPU, $db, $col, $current_row, 'on_cpu', $snaps_table, $last_snap_time);
    cells($rec->SIDS_USER_IO, $db, $col, $current_row, 'userio', $snaps_table, $last_snap_time);
    cells($rec->SIDS_SYSTEM_IO, $db, $col, $current_row, 'sys_io', $snaps_table, $last_snap_time);
    cells($rec->SIDS_BLOCKED, $db, $col, $current_row, 'locked', $snaps_table, $last_snap_time);
    cells($rec->OTHERS, $db, $col, $current_row, 'others', $snaps_table, $last_snap_time);
    #
    # Graph topper cell
    # - need prev, current and next graph heights
    # - so we will do the top of the last col
    #