Source
static void preprocessor_add_item_stats(zbx_uint64_t itemid, zbx_preprocessing_states_t state, zbx_hashset_t *items,
/*
** 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.
**/
extern ZBX_THREAD_LOCAL unsigned char process_type;
extern unsigned char program_type;
extern ZBX_THREAD_LOCAL int server_num, process_num;
extern int CONFIG_PREPROCESSOR_FORKS;
typedef enum
{
REQUEST_STATE_QUEUED = 0, /* requires preprocessing */
REQUEST_STATE_PROCESSING = 1, /* is being preprocessed */
REQUEST_STATE_DONE = 2, /* value is set, waiting for flush */
REQUEST_STATE_PENDING = 3, /* value requires preprocessing, */
/* but is waiting on other request to complete */
}
zbx_preprocessing_states_t;
typedef enum
{
ZBX_PREPROC_ITEM, /* item preprocessing request */
ZBX_PREPROC_DEPS /* dependent item preprocessing request */
}
zbx_preprocessing_kind_t;
typedef struct zbx_preprocessing_request_base zbx_preprocessing_request_base_t;
ZBX_PTR_VECTOR_DECL(preprocessing_request_base, zbx_preprocessing_request_base_t *)
ZBX_PTR_VECTOR_IMPL(preprocessing_request_base, zbx_preprocessing_request_base_t *)
struct zbx_preprocessing_request_base
{
zbx_preprocessing_kind_t kind;
zbx_preprocessing_states_t state;
zbx_preprocessing_request_base_t *pending; /* the request waiting on this request to complete */
zbx_vector_preprocessing_request_base_t flush_queue; /* processed request waiting to be flushed */
};
/* preprocessing request */
typedef struct preprocessing_request
{
zbx_preprocessing_request_base_t base; /* common data for various requests - must be first */
/* field preprocessing request structure */
zbx_preproc_item_value_t value; /* unpacked item value */
zbx_preproc_op_t *steps; /* preprocessing steps */
int steps_num; /* number of preprocessing steps */
unsigned char value_type; /* value type from configuration */
/* at the beginning of preprocessing queue */
}
zbx_preprocessing_request_t;
/* bulk dependent item preprocessing request*/
typedef struct
{
zbx_preprocessing_request_base_t base; /* common data for various requests - must be first */
/* field preprocessing request structure */
zbx_uint64_t hostid;
zbx_uint64_t master_itemid;
unsigned char value_type; /* value type for items without preproc config */