mirror of
https://github.com/pragma-/pbot.git
synced 2025-02-02 07:24:09 +01:00
Flag SQLite queries that take more than 100ms to complete, if SQL logging is enabled
This commit is contained in:
parent
c8d2f8e632
commit
cc3154a2c6
@ -43,7 +43,10 @@ sub log_message {
|
||||
my $self = shift;
|
||||
my $now = gettimeofday;
|
||||
my $elapsed = $now - $self->{timestamp};
|
||||
$elapsed = sprintf '%10.4f', $elapsed;
|
||||
if ($elapsed >= 0.100) {
|
||||
$self->{pbot}->{logger}->log("^^^ SLOW SQL ^^^\n");
|
||||
}
|
||||
$elapsed = sprintf '%10.3f', $elapsed;
|
||||
$self->{pbot}->{logger}->log("$elapsed : $self->{buf}");
|
||||
$self->{timestamp} = $now;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user