Source
int zbx_timekeeper_get_stat(zbx_timekeeper_t *timekeeper, int unit_index, int count, unsigned char aggr_func,
/*
** 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.
**/
/* 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;