}
ucl_object_insert_key (top, sub, "actions", 0, false);
+ sub = ucl_object_typed_new (UCL_ARRAY);
+ for (i = 0; i < MAX_AVG_TIME_SLOTS; i++) {
+ ucl_array_append (sub, ucl_object_fromdouble (stat->avg_time.avg_time[i]));
+ }
+ ucl_object_insert_key (top, sub, "scan_times", 0, false);
+
ucl_object_insert_key (top, ucl_object_fromint (
spam), "spam_count", 0, false);
ucl_object_insert_key (top, ucl_object_fromint (
#ifndef HAVE_ATOMIC_BUILTINS
slot = task->worker->srv->stat->avg_time.cur_slot++;
#else
- slot = __atomic_add_fetch (&task->worker->srv->stat->avg_time.cur_slot,
+ slot = __atomic_fetch_add (&task->worker->srv->stat->avg_time.cur_slot,
1, __ATOMIC_RELEASE);
#endif
slot = slot % MAX_AVG_TIME_SLOTS;
sizeof (struct rspamd_stat),
RSPAMD_ALIGNOF(struct rspamd_stat),
G_STRLOC);
+ /* Set all time slots to nan */
+ for (i = 0; i < MAX_AVG_TIME_SLOTS; i ++) {
+ rspamd_main->stat->avg_time.avg_time[i] = NAN;
+ }
+
rspamd_main->cfg = rspamd_config_new (RSPAMD_CONFIG_INIT_DEFAULT);
rspamd_main->spairs = g_hash_table_new_full (rspamd_spair_hash,
rspamd_spair_equal, g_free, rspamd_spair_close);