diff --git a/src/class-laps.php b/src/class-laps.php index 28429dc..1e142d6 100644 --- a/src/class-laps.php +++ b/src/class-laps.php @@ -164,6 +164,7 @@ class Laps { jQuery(".laps-timeline .event").lapstooltip({ container: '#wpadminbar' , placement: 'bottom' + , html: true // , trigger: 'click' }); }); @@ -205,6 +206,8 @@ class Laps { $query_data = array(); $last_query_end = 0; + $last_offset = 0; + $last_duration = 0; $category = 'query'; if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { @@ -215,7 +218,28 @@ class Laps { $duration *= 1000; $last_query_end = $query_start + $duration; $offset = round( ( $query_start - $start ) / $total * 100, 2 ); - $width = round( $duration / $total * 100, 2 ); + + // if query is indistinguishably close to previous then stack it + if ( $offset == $last_offset ) { + $key = count( $query_data ) - 1; + $query_data[$key]['sql'] .= '
' . $sql; + $last_duration += $duration; + $width = round( $last_duration / $total * 100, 2 ); + + if ( 0 == $width ) { + $width = '2px'; + } else { + $width .= '%'; + } + + $query_data[$key]['width'] = $width; + + continue; + } + + $width = round( $duration / $total * 100, 2 ); + $last_offset = $offset; + $last_duration = $duration; if ( 0 == $width ) { $width = '2px';