AT&T ECOMP Vendor Event Listener library
0.1
|
Event Manager. More...
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <limits.h>
#include <pthread.h>
#include <search.h>
#include "evel_throttle.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
#define | JSON_TOKEN_TYPES (JSMN_PRIMITIVE + 1) |
Functions | |
int | evel_get_measurement_interval () |
Return the current measurement interval provided by the Event Listener. More... | |
EVEL_THROTTLE_SPEC * | evel_get_throttle_spec (EVEL_EVENT_DOMAINS domain) |
Return the EVEL_THROTTLE_SPEC for a given domain. More... | |
bool | evel_throttle_suppress_field (EVEL_THROTTLE_SPEC *throttle_spec, const char *const field_name) |
Determine whether a field_name should be suppressed. More... | |
bool | evel_throttle_suppress_nv_pair (EVEL_THROTTLE_SPEC *throttle_spec, const char *const field_name, const char *const name) |
Determine whether a name-value pair should be allowed (not suppressed). More... | |
void | evel_throttle_initialize () |
Initialize event throttling to the default state. More... | |
void | evel_throttle_terminate () |
Clean up event throttling. More... | |
bool | evel_handle_command_list (const MEMORY_CHUNK *const chunk, const jsmntok_t *const json_tokens, const int num_tokens, MEMORY_CHUNK *const post) |
Handle a JSON response from the listener, as a list of tokens from JSMN. More... | |
Variables | |
EVEL_JSON_COMMAND_STATE | evel_json_command_state |
Event Manager.
Simple event manager that is responsible for taking events (Heartbeats, Faults and Measurements) from the ring-buffer and posting them to the API.
Copyright(c) <2016>, AT&T Intellectual Property. All other rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file evel_throttle.c.
#define _GNU_SOURCE |
Definition at line 40 of file evel_throttle.c.
#define JSON_TOKEN_TYPES (JSMN_PRIMITIVE + 1) |
Definition at line 126 of file evel_throttle.c.
int evel_get_measurement_interval | ( | ) |
Return the current measurement interval provided by the Event Listener.
EVEL_MEASUREMENT_INTERVAL_UKNOWN | (0) - interval has not been specified |
Definition at line 206 of file evel_throttle.c.
EVEL_THROTTLE_SPEC* evel_get_throttle_spec | ( | EVEL_EVENT_DOMAINS | domain | ) |
Return the EVEL_THROTTLE_SPEC for a given domain.
domain | The domain for which to return state. |
Definition at line 229 of file evel_throttle.c.
bool evel_handle_command_list | ( | const MEMORY_CHUNK *const | chunk, |
const jsmntok_t *const | json_tokens, | ||
const int | num_tokens, | ||
MEMORY_CHUNK *const | post | ||
) |
Handle a JSON response from the listener, as a list of tokens from JSMN.
chunk | Memory chunk containing the JSON buffer. |
json_tokens | Array of tokens to handle. |
num_tokens | The number of tokens to handle. |
post | The memory chunk in which to place any resulting POST. |
Definition at line 648 of file evel_throttle.c.
void evel_throttle_initialize | ( | ) |
Initialize event throttling to the default state.
Called from evel_initialize.
Definition at line 352 of file evel_throttle.c.
bool evel_throttle_suppress_field | ( | EVEL_THROTTLE_SPEC * | throttle_spec, |
const char *const | field_name | ||
) |
Determine whether a field_name should be suppressed.
throttle_spec | Throttle specification for the domain being encoded. |
field_name | The field name to encoded or suppress. |
Definition at line 254 of file evel_throttle.c.
bool evel_throttle_suppress_nv_pair | ( | EVEL_THROTTLE_SPEC * | throttle_spec, |
const char *const | field_name, | ||
const char *const | name | ||
) |
Determine whether a name-value pair should be allowed (not suppressed).
throttle_spec | Throttle specification for the domain being encoded. |
field_name | The field name holding the name-value pairs. |
name | The name of the name-value pair to encoded or suppress. |
Definition at line 293 of file evel_throttle.c.
void evel_throttle_terminate | ( | ) |
Clean up event throttling.
Called from evel_terminate.
Definition at line 377 of file evel_throttle.c.
EVEL_JSON_COMMAND_STATE evel_json_command_state |
Definition at line 106 of file evel_throttle.c.