2 * collectd - src/utils_cache.h
3 * Copyright (C) 2007 Florian octo Forster
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 * Florian octo Forster <octo at collectd.org>
28 #define UTILS_CACHE_H 1
33 #define STATE_WARNING 1
35 #define STATE_MISSING 15
38 int uc_check_timeout (void);
39 int uc_update (const data_set_t *ds, const value_list_t *vl);
40 int uc_get_rate_by_name (const char *name, gauge_t **ret_values, size_t *ret_values_num);
41 gauge_t *uc_get_rate (const data_set_t *ds, const value_list_t *vl);
43 int uc_get_names (char ***ret_names, cdtime_t **ret_times, size_t *ret_number);
45 int uc_get_state (const data_set_t *ds, const value_list_t *vl);
46 int uc_set_state (const data_set_t *ds, const value_list_t *vl, int state);
47 int uc_get_hits (const data_set_t *ds, const value_list_t *vl);
48 int uc_set_hits (const data_set_t *ds, const value_list_t *vl, int hits);
49 int uc_inc_hits (const data_set_t *ds, const value_list_t *vl, int step);
51 int uc_get_history (const data_set_t *ds, const value_list_t *vl,
52 gauge_t *ret_history, size_t num_steps, size_t num_ds);
53 int uc_get_history_by_name (const char *name,
54 gauge_t *ret_history, size_t num_steps, size_t num_ds);
59 int uc_meta_data_exists (const value_list_t *vl, const char *key);
60 int uc_meta_data_delete (const value_list_t *vl, const char *key);
62 int uc_meta_data_add_string (const value_list_t *vl,
65 int uc_meta_data_add_signed_int (const value_list_t *vl,
68 int uc_meta_data_add_unsigned_int (const value_list_t *vl,
71 int uc_meta_data_add_double (const value_list_t *vl,
74 int uc_meta_data_add_boolean (const value_list_t *vl,
78 int uc_meta_data_get_string (const value_list_t *vl,
81 int uc_meta_data_get_signed_int (const value_list_t *vl,
84 int uc_meta_data_get_unsigned_int (const value_list_t *vl,
87 int uc_meta_data_get_double (const value_list_t *vl,
90 int uc_meta_data_get_boolean (const value_list_t *vl,
94 /* vim: set shiftwidth=2 softtabstop=2 tabstop=8 : */
95 #endif /* !UTILS_CACHE_H */