Arg update required touching also threshold.c & write_riemann plugin.
Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
return 0;
} /* int uc_get_names */
-int uc_get_state(const data_set_t *ds, const value_list_t *vl) {
+int uc_get_state(const value_list_t *vl) {
char name[6 * DATA_MAX_NAME_LEN];
cache_entry_t *ce = NULL;
int ret = STATE_ERROR;
return ret;
} /* int uc_get_state */
-int uc_set_state(const data_set_t *ds, const value_list_t *vl, int state) {
+int uc_set_state(const value_list_t *vl, int state) {
char name[6 * DATA_MAX_NAME_LEN];
cache_entry_t *ce = NULL;
int ret = -1;
return 0;
} /* int uc_get_history_by_name */
-int uc_get_history(const data_set_t *ds, const value_list_t *vl,
- gauge_t *ret_history, size_t num_steps, size_t num_ds) {
- char name[6 * DATA_MAX_NAME_LEN];
-
- if (FORMAT_VL(name, sizeof(name), vl) != 0) {
- ERROR("utils_cache: uc_get_history: FORMAT_VL failed.");
- return -1;
- }
-
- return uc_get_history_by_name(name, ret_history, num_steps, num_ds);
-} /* int uc_get_history */
-
-int uc_get_hits(const data_set_t *ds, const value_list_t *vl) {
+int uc_get_hits(const value_list_t *vl) {
char name[6 * DATA_MAX_NAME_LEN];
cache_entry_t *ce = NULL;
int ret = STATE_ERROR;
return ret;
} /* int uc_get_hits */
-int uc_set_hits(const data_set_t *ds, const value_list_t *vl, int hits) {
+int uc_set_hits(const value_list_t *vl, int hits) {
char name[6 * DATA_MAX_NAME_LEN];
cache_entry_t *ce = NULL;
int ret = -1;
return ret;
} /* int uc_set_hits */
-int uc_inc_hits(const data_set_t *ds, const value_list_t *vl, int step) {
+int uc_inc_hits(const value_list_t *vl, int step) {
char name[6 * DATA_MAX_NAME_LEN];
cache_entry_t *ce = NULL;
int ret = -1;
size_t uc_get_size(void);
int uc_get_names(char ***ret_names, cdtime_t **ret_times, size_t *ret_number);
-int uc_get_state(const data_set_t *ds, const value_list_t *vl);
-int uc_set_state(const data_set_t *ds, const value_list_t *vl, int state);
-int uc_get_hits(const data_set_t *ds, const value_list_t *vl);
-int uc_set_hits(const data_set_t *ds, const value_list_t *vl, int hits);
-int uc_inc_hits(const data_set_t *ds, const value_list_t *vl, int step);
+int uc_get_state(const value_list_t *vl);
+int uc_set_state(const value_list_t *vl, int state);
+int uc_get_hits(const value_list_t *vl);
+int uc_set_hits(const value_list_t *vl, int hits);
+int uc_inc_hits(const value_list_t *vl, int step);
int uc_set_callbacks_mask(const char *name, unsigned long callbacks_mask);
-int uc_get_history(const data_set_t *ds, const value_list_t *vl,
- gauge_t *ret_history, size_t num_steps, size_t num_ds);
int uc_get_history_by_name(const char *name, gauge_t *ret_history,
size_t num_steps, size_t num_ds);
/* Check if hits matched */
if ((th->hits != 0)) {
- int hits = uc_get_hits(ds, vl);
+ int hits = uc_get_hits(vl);
/* STATE_OKAY resets hits unless PERSIST_OK flag is set. Hits resets if
* threshold is hit. */
if (((state == STATE_OKAY) && ((th->flags & UT_FLAG_PERSIST_OK) == 0)) ||
(hits > th->hits)) {
DEBUG("ut_report_state: reset uc_get_hits = 0");
- uc_set_hits(ds, vl, 0); /* reset hit counter and notify */
+ uc_set_hits(vl, 0); /* reset hit counter and notify */
} else {
DEBUG("ut_report_state: th->hits = %d, uc_get_hits = %d", th->hits,
- uc_get_hits(ds, vl));
- (void)uc_inc_hits(ds, vl, 1); /* increase hit counter */
+ uc_get_hits(vl));
+ (void)uc_inc_hits(vl, 1); /* increase hit counter */
return 0;
}
} /* end check hits */
- state_old = uc_get_state(ds, vl);
+ state_old = uc_get_state(vl);
/* If the state didn't change, report if `persistent' is specified. If the
* state is `okay', then only report if `persist_ok` flag is set. */
}
if (state != state_old)
- uc_set_state(ds, vl, state);
+ uc_set_state(vl, state);
NOTIFICATION_INIT_VL(&n, vl);
/* XXX: This is an experimental code, not optimized, not fast, not reliable,
* and probably, do not work as you expect. Enjoy! :D */
if (th->hysteresis > 0) {
- prev_state = uc_get_state(ds, vl);
+ prev_state = uc_get_state(vl);
/* The purpose of hysteresis is elliminating flapping state when the value
* oscilates around the thresholds. In other words, what is important is
* the previous state; if the new value would trigger a transition, make
/* XXX: This is an experimental code, not optimized, not fast, not reliable,
* and probably, do not work as you expect. Enjoy! :D */
- prev_state = uc_get_state(ds, vl);
+ prev_state = uc_get_state(vl);
if ((th->hysteresis > 0) && (prev_state != STATE_OKAY) &&
(prev_state != STATE_UNKNOWN)) {
switch (prev_state) {