Commit 024bdc58 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Logs : affichage de la durée d'exécution

parent 83dfefb2
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -228,6 +228,22 @@ abstract class AbstractImportLog
        return $this;
    }

    /**
     * Retourne la durée d'exécution en secondes, d'après les dates de début et de fin.
     */
    public function getDurationInSeconds(): int
    {
        return (int) $this->endedOn->diff($this->startedOn)->format('s');
    }

    /**
     * Retourne la durée d'exécution au format "H min s", d'après les dates de début et de fin.
     */
    public function getDurationToString(): string
    {
        return $this->endedOn->diff($this->startedOn)->format('%Hh %Imin %Ss');
    }

    /**
     * @return string|null
     */
+8 −2
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@ $synchroConsultable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPr
            <th>
                <?php echo $this->translate("Terminé le"); ?>
            </th>
            <th>
                <?php echo $this->translate("Durée"); ?>
            </th>
        </tr>
        </thead>

@@ -109,10 +112,13 @@ $synchroConsultable = $this->isAllowed(SynchroPrivilege::getResourceId(SynchroPr
                    <?php endif ?>
                </td>
                <td>
                    <?php echo $log->getStartedOn()->format('d/m/Y H:i:s') ?>
                    <?php echo $log->getStartedOnToString() ?>
                </td>
                <td>
                    <?php echo $log->getEndedOnToString() ?>
                </td>
                <td>
                    <?php echo $log->getEndedOn()->format('d/m/Y H:i:s') ?>
                    <?php echo $log->getDurationToString() ?>
                </td>
            </tr>
        <?php endforeach; ?>
+2 −0
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@
    <dd class="col-md-9"><?php echo $importLog->getStartedOnToString() ; ?></dd>
    <dt class="col-md-3">Terminé le</dt>
    <dd class="col-md-9"><?php echo $importLog->getEndedOnToString() ; ?></dd>
    <dt class="col-md-3">Durée</dt>
    <dd class="col-md-9"><?php echo $importLog->getDurationToString() ; ?></dd>
    <dt class="col-md-3">Log</dt>
    <dd class="col-md-9"><pre><?php echo $importLog->getLog() ?></dd>
</dl>