From 85c2187884d0b9082d9b95bce0a1a90bf6199bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Tue, 27 Apr 2021 13:32:39 +0200 Subject: [PATCH] Closes #3376: Removed unnecessary operations to compute 'first_seen' and 'last_seen' timestamps for 'stats_mysql_errors' --- lib/MySQL_HostGroups_Manager.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/MySQL_HostGroups_Manager.cpp b/lib/MySQL_HostGroups_Manager.cpp index 9917e19cf..c8ece9e37 100644 --- a/lib/MySQL_HostGroups_Manager.cpp +++ b/lib/MySQL_HostGroups_Manager.cpp @@ -5951,17 +5951,10 @@ class MySQL_Errors_stats { sprintf(buf,"%llu",count_star); pta[7]=strdup(buf); - time_t __now; - time(&__now); - unsigned long long curtime=monotonic_time(); - time_t seen_time; - - seen_time= __now - curtime/1000000 + first_seen/1000000; - sprintf(buf,"%ld", seen_time); + sprintf(buf,"%ld", first_seen); pta[8]=strdup(buf); - seen_time= __now - curtime/1000000 + last_seen/1000000; - sprintf(buf,"%ld", seen_time); + sprintf(buf,"%ld", last_seen); pta[9]=strdup(buf); assert(last_error);