Identify BAD scenes by looking at execution time

Domotica gratuit Forums How can I …? Exemples Blocky Identify BAD scenes by looking at execution time

Ce sujet a 0 réponse, 1 participant et a été mis à jour par  djandib, il y a 1 an et 3 mois.

Affichage de 1 message (sur 1 au total)
  • Auteur
    Messages
  • #11723

    djandib
    Participant

    Sometimes it may happen, that a scene is buggy and slows down you complete system.
    For that case, you can use microtime to have a look at the total execution time:
    **********
    PHP-Block
    //place this BEFORE any script you want to calculate time
    $time_start = microtime(true);
    **********
    PHP-Block
    //place this AFTER any script you want to calculate
    $time_end = microtime(true);
    $execution_time = round($time_end – $time_start,2);
    **********
    Add-Log Block
    **********

    In my case I added a log, if I switch on my virtual binary switch “Healthcheck” or execution_Time is > 1 sec.

    Andi
    ****************
    https://snag.gy/o7ePzG.jpg

Affichage de 1 message (sur 1 au total)

Vous devez être connecté pour répondre à ce sujet.