for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/** @var \Symfony\Component\Stopwatch\Stopwatch $watcher */
$watcher = $stopwatch;
$sections = $watcher->getSections();
function dumpCase($color, $letter)
{
?>
<td style="background: <?php echo $color; ?>; color: <?php echo $color; ?>;"><?php echo $letter; ?></td>
}
<style>
table {
border-spacing: 0px;
td {
width: 1px;
</style>
<table>
<?php foreach ($sections as $section) { ?>
<tr>
<th>Nom de l'event</th>
</tr>
<?php $graph = $section->getEvent('main'); ?>
<?php $duration = $graph->getDuration(); ?>
<?php $nbmili = 1; ?>
<td> GRAPH </td>
<?php for($i = 1; $i <= $duration / $nbmili; $i++) { ?>
<td style="background: blue; color: white; font-weight: bold;" colspan="<?php echo $nbmili; ?>"><?php echo $i * $nbmili; ?>ms</td>
<?php } ?>
<?php foreach ($section->getEvents() as $name => $event) { ?>
<?php if ($name !== 'main' && count($event->getPeriods()) > 0) { ?>
<td> <?php echo $name; ?></td>
<?php $cursor = 0; ?>
<?php $periods = $event->getPeriods(); ?>
<?php $current = array_shift($periods); ?>
<?php for($i = 1; $i <= $duration; $i++) { ?>
$color = 'black';
$end = false;
$delay = $event->getOrigin() - $graph->getOrigin();
while (null !== $current && ($current->getEndTime() + $delay) < $i) {
$current = array_shift($periods);
$end = true;
if (null !== $current) {
if (($current->getStartTime() + $delay) > $i) {
$color = 'white';
elseif (($current->getEndTime() + $delay) >= $i) {
$color = 'green';
} else {
$color= 'white';
$letter = ($current) ? $current->getStartTime() : -1;
<td style="<?php if($end) { echo 'border-bottom: solid red 2px;'; } ?> background: <?php echo $color; ?>; color: <?php echo $color; ?>;"></td>