Source
int zbx_timekeeper_get_stat(zbx_timekeeper_t *timekeeper, int unit_index, int count, unsigned char aggr_func,
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/* number of process states */
typedef struct zbx_timekeeper zbx_timekeeper_t;
typedef struct
{
double busy_max;
double busy_min;
double busy_avg;
double idle_max;
double idle_min;
double idle_avg;
}
zbx_timekeeper_stats_t;
typedef struct
{
unsigned short counter[ZBX_PROCESS_STATE_COUNT];
}
zbx_timekeeper_state_t;
typedef void (*zbx_timekeeper_sync_func_t)(void *data);
typedef struct
{
zbx_timekeeper_sync_func_t lock;
zbx_timekeeper_sync_func_t unlock;
void *data;
}
zbx_timekeeper_sync_t;
void zbx_timekeeper_sync_init(zbx_timekeeper_sync_t *sync, zbx_timekeeper_sync_func_t lock,
zbx_timekeeper_sync_func_t unlock, void *data);
size_t zbx_timekeeper_get_memmalloc_size(int units_num);