Closed geraldhofer closed 4 years ago
agree with you, first DB query is not considered as part of policy run duration. this should do it, need to be tested.
--- policy_run.c.orig 2019-10-22 10:41:30.787000000 +0200
+++ policy_run.c 2019-10-22 10:44:29.637000000 +0200
@@ -1963,6 +1963,8 @@
nb_returned = 0;
total_returned = 0;
+ p_pol_info->progress.policy_start = time(NULL);
+
rc = iter_open(lmgr,
p_pol_info->descr->manage_deleted ? IT_RMD : IT_LIST,
&it, &filter, &sort_type, &opt);
@@ -1974,8 +1976,7 @@
return -1;
}
- p_pol_info->progress.policy_start = p_pol_info->progress.last_report
- = time(NULL);
+ p_pol_info->progress.last_report = time(NULL);
/* reinit schedulers */
for (i = 0; i < p_pol_info->config->sched_count; i++) {
Fix included in version 3.1.6: https://sourceforge.net/projects/robinhood/files/robinhood/3.1.6/
rbh-report does include a very helpful output that shows the duration of the last run policy:
But I learned that that is only half the story. I have turned on the logging of slow queries in mariadb and this is the database query that gets run as part of that policy:
So that policy does spent the majority of the time in the database query. It would be very helpful if that database query could be part of the duration that is reported by rbh-report -a.