Source
if (ZBX_TIMEKEEPER_FLUSH_DELAY < (double)(ticks - unit->cache.ticks_flush) / (double)timekeeper->ticks_per_sec)
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/* unit state cache, updated only by the execution units themselves */
typedef struct
{
/* the current usage statistics */
zbx_uint64_t counter[ZBX_PROCESS_STATE_COUNT];
/* ticks of the last timekeeper update */
clock_t ticks;
/* ticks of the last timekeeper cache flush */
clock_t ticks_flush;
/* the current process state (see ZBX_PROCESS_STATE_* defines) */
unsigned char state;
}
zbx_timekeeper_unit_cache_t;
/* execution unit state statistics */
typedef struct
{
/* historical unit state data */
zbx_uint64_t h_counter[ZBX_PROCESS_STATE_COUNT][MAX_HISTORY];
/* unit state data for the current data gathering cycle */
zbx_uint64_t counter[ZBX_PROCESS_STATE_COUNT];
/* the unit state that was already applied to the historical state data */
zbx_uint64_t counter_used[ZBX_PROCESS_STATE_COUNT];
/* the unit state cache */
zbx_timekeeper_unit_cache_t cache;
}
zbx_timekeeper_unit_t;
typedef enum