2 * collectd - src/utils_curl_stats.h
3 * Copyright (C) 2015 Sebastian 'tokkee' Harl
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 * Sebastian Harl <sh@tokkee.org>
27 #ifndef UTILS_CURL_STATS_H
28 #define UTILS_CURL_STATS_H 1
30 #include "configfile.h"
33 #include <curl/curl.h>
36 typedef struct curl_stats_s curl_stats_t;
39 * curl_stats_from_config allocates and constructs a cURL statistics object
40 * from the specified configuration which is expected to be a single block of
41 * boolean options named after cURL information fields. The boolean value
42 * indicates whether to collect the respective information.
44 * See http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html
46 curl_stats_t *curl_stats_from_config (oconfig_item_t *ci);
48 void curl_stats_destroy (curl_stats_t *s);
51 * curl_stats_dispatch dispatches performance values from the the specified
52 * cURL session to the daemon.
54 int curl_stats_dispatch (curl_stats_t *s, CURL *curl,
55 const char *hostname, const char *plugin, const char *plugin_instance);
57 #endif /* UTILS_CURL_STATS_H */