Source
static void diag_add_lld_items(struct zbx_json *json, const char *field, const zbx_vector_uint64_pair_t *items)
/*
** 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/>.
**/
/******************************************************************************
* *
* Purpose: sort itemid,values_num pair by values_num in descending order *
* *
******************************************************************************/
static int diag_valuecache_item_compare_values(const void *d1, const void *d2)
{
zbx_vc_item_stats_t *i1 = *(zbx_vc_item_stats_t **)d1;
zbx_vc_item_stats_t *i2 = *(zbx_vc_item_stats_t **)d2;
return i2->values_num - i1->values_num;
}
/******************************************************************************
* *
* Purpose: sort itemid,values_num pair by hourly_num in descending order *
* *
******************************************************************************/
static int diag_valuecache_item_compare_hourly(const void *d1, const void *d2)
{
zbx_vc_item_stats_t *i1 = *(zbx_vc_item_stats_t **)d1;
zbx_vc_item_stats_t *i2 = *(zbx_vc_item_stats_t **)d2;
return i2->hourly_num - i1->hourly_num;
}
/******************************************************************************
* *
* Purpose: add valuecache items diagnostic statistics to json *
* *