Source
zbx_json_addfloat(json, "pused", 100 * (double)(wcache_info.history_total - wcache_info.history_free) /
/*
** Zabbix
** Copyright (C) 2001-2023 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.
**/
static zbx_get_program_type_f get_program_type_cb;
static zbx_vector_stats_ext_func_t stats_ext_funcs;
static zbx_vector_stats_ext_func_t stats_data_funcs;
ZBX_PTR_VECTOR_IMPL(stats_ext_func, zbx_stats_ext_func_entry_t *)
void zbx_init_library_stats(zbx_get_program_type_f get_program_type)
{
get_program_type_cb = get_program_type;
zbx_vector_stats_ext_func_create(&stats_data_funcs);
zbx_vector_stats_ext_func_create(&stats_ext_funcs);
}
/******************************************************************************
* *
* Purpose: register callback to add information to main element *
* *
* Parameters: stats_ext_get_cb - [IN] statistics extension callback *
* arg - [IN] argument passed to callback *
* *
******************************************************************************/
void zbx_register_stats_ext_func(zbx_zabbix_stats_ext_get_func_t stats_ext_get_cb, const void *arg)
{
zbx_stats_ext_func_entry_t *entry;
entry = (zbx_stats_ext_func_entry_t *)zbx_malloc(NULL, sizeof(zbx_stats_ext_func_entry_t));
entry->arg = arg;
entry->stats_ext_get_cb = stats_ext_get_cb;
zbx_vector_stats_ext_func_append(&stats_ext_funcs, entry);
}
/******************************************************************************
* *
* Purpose: register callback to add information to data sub-element *