Source
zabbix_log(LOG_LEVEL_WARNING, "estimated trends function cache slot count %u for " ZBX_FS_UI64 " bytes was "
/*
** 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.
**/
typedef struct
{
zbx_uint64_t itemid; /* the itemid */
int start; /* the period start time */
int end; /* the period end time */
zbx_trend_function_t function; /* the trends function */
zbx_trend_state_t state; /* the cached value state */
double value; /* the cached value */
zbx_uint32_t prev; /* index of the previous LRU list or unused entry */
zbx_uint32_t next; /* index of the next LRU list or unused entry */
zbx_uint32_t prev_value; /* index of the previous value list */
zbx_uint32_t next_value; /* index of the next value list */
}
zbx_tfc_data_t;
typedef struct
{
char header[ZBX_HASHSET_ENTRY_OFFSET];
zbx_tfc_data_t data;
}
zbx_tfc_slot_t;
typedef struct
{
zbx_hashset_t index;
zbx_tfc_slot_t *slots;
size_t slots_size;
zbx_uint32_t slots_num;
zbx_uint32_t free_slot;
zbx_uint32_t free_head;
zbx_uint32_t lru_head;
zbx_uint32_t lru_tail;
zbx_uint64_t hits;
zbx_uint64_t misses;
zbx_uint64_t items_num;