Skip to content

Commit

Permalink
apimon-db: correct reported duration on err
Browse files Browse the repository at this point in the history
count the duration from the last connect attempt, not from the start
  • Loading branch information
erankor committed Dec 29, 2021
1 parent 80a048c commit a967c3c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vendor/propel/Propel.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,14 @@ public static function initConnection($conparams, $name, $defaultClass = Propel:
}
}

$totalConnTook = microtime(true) - $connStartTime;
$connEndTime = microtime(true);
$totalConnTook = $connEndTime - $connStartTime;

if (class_exists("KalturaLog"))
KalturaLog::Log("total conn took $totalConnTook $dsn");

if (class_exists("KalturaMonitorClient"))
KalturaMonitorClient::monitorConnTook($dsn, $totalConnTook);
KalturaMonitorClient::monitorConnTook($dsn, $connEndTime - $startTime);

// load any connection options from the config file
// connection attributes are those PDO flags that have to be set on the initialized connection
Expand Down

0 comments on commit a967c3c

Please sign in to comment.