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);
44 int uc_get_names (char ***ret_names, cdtime_t **ret_times, size_t *ret_number);
46 int uc_get_state (const data_set_t *ds, const value_list_t *vl);
47 int uc_set_state (const data_set_t *ds, const value_list_t *vl, int state);
48 int uc_get_hits (const data_set_t *ds, const value_list_t *vl);
49 int uc_set_hits (const data_set_t *ds, const value_list_t *vl, int hits);
50 int uc_inc_hits (const data_set_t *ds, const value_list_t *vl, int step);
52 int uc_get_history (const data_set_t *ds, const value_list_t *vl,
53 gauge_t *ret_history, size_t num_steps, size_t num_ds);
54 int uc_get_history_by_name (const char *name,
55 gauge_t *ret_history, size_t num_steps, size_t num_ds);
60 int uc_meta_data_exists (const value_list_t *vl, const char *key);
61 int uc_meta_data_delete (const value_list_t *vl, const char *key);
63 int uc_meta_data_add_string (const value_list_t *vl,
66 int uc_meta_data_add_signed_int (const value_list_t *vl,
69 int uc_meta_data_add_unsigned_int (const value_list_t *vl,
72 int uc_meta_data_add_double (const value_list_t *vl,
75 int uc_meta_data_add_boolean (const value_list_t *vl,
79 int uc_meta_data_get_string (const value_list_t *vl,
82 int uc_meta_data_get_signed_int (const value_list_t *vl,
85 int uc_meta_data_get_unsigned_int (const value_list_t *vl,
88 int uc_meta_data_get_double (const value_list_t *vl,
91 int uc_meta_data_get_boolean (const value_list_t *vl,
95 /* vim: set shiftwidth=2 softtabstop=2 tabstop=8 : */
96 #endif /* !UTILS_CACHE_H */