zabbix-agent2/src/libs/zbxhistory/history.c
/************************************************************************************
 *                                                                                  *
 * Function: zbx_history_add_values                                                 *
 *                                                                                  *
 * Purpose: Sends values to the history storage                                     *
 *                                                                                  *
 * Parameters: history - [IN] the values to store                                   *
 *                                                                                  *
 * Comments: add history values to the configured storage backends                  *
 *                                                                                  *
 ************************************************************************************/
zbx_history_add_values

Purpose: Sends values to the history storage

Parameters: history - [IN] the values to store

Comments: add history values to the configured storage backends
zbx_history_add_values Purpose : Sends values to the history storage Parameters : history - [ IN ] the values to store Comments : add history values to the configured storage backends
int	zbx_history_add_values(const zbx_vector_ptr_t *history, int *ret_flush)
{
	int	i, flags = 0;
	*ret_flush = FLUSH_SUCCEED;
	zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __func__);
	for (i = 0; i < ITEM_VALUE_TYPE_MAX; i++)
	{
		zbx_history_iface_t	*writer = &history_ifaces[i];
		if (0 < writer->add_values(writer, history))
			flags |= (1 << i);
	}
	for (i = 0; i < ITEM_VALUE_TYPE_MAX; i++)
	{
		zbx_history_iface_t	*writer = &history_ifaces[i];
		if (0 != (flags & (1 << i)))
		{
			if (FLUSH_DUPL_REJECTED == (*ret_flush = writer->flush(writer)))
				break;
		}
	}
	zabbix_log(LOG_LEVEL_DEBUG, "End of %s()", __func__);
	return (FLUSH_SUCCEED == *ret_flush ? SUCCEED : FAIL);
}
int zbx_history_add_values ( const zbx_vector_ptr_t * history , int * ret_flush ) { int i , flags = 0 ; * ret_flush = FLUSH_SUCCEED ; zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ ) ; for ( i = 0 ; i < ITEM_VALUE_TYPE_MAX ; i ++ ) { zbx_history_iface_t * writer = & history_ifaces [ i ] ; if ( 0 < writer -> add_values ( writer , history ) ) flags |= ( 1 << i ) ; } for ( i = 0 ; i < ITEM_VALUE_TYPE_MAX ; i ++ ) { zbx_history_iface_t * writer = & history_ifaces [ i ] ; if ( 0 != ( flags & ( 1 << i ) ) ) { if ( FLUSH_DUPL_REJECTED == ( * ret_flush = writer -> flush ( writer ) ) ) break ; } } zabbix_log ( LOG_LEVEL_DEBUG , " " , __func__ ) ; return ( FLUSH_SUCCEED == * ret_flush ? SUCCEED : FAIL ) ; }
Function: zbx_history_add_values                                                 
                                                                                  
 Purpose: Sends values to the history storage                                     
                                                                                  
 Parameters: history - [IN] the values to store                                   
                                                                                  
 Comments: add history values to the configured storage backends
Function : zbx_history_add_values Purpose : Sends values to the history storage Parameters : history - [ IN ] the values to store Comments : add history values to the configured storage backends