From: Florian Forster Date: Thu, 18 Oct 2012 10:43:30 +0000 (+0200) Subject: Merge branch 'collectd-4.10' into collectd-5.0 X-Git-Tag: collectd-5.0.5~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=400596160704146845940d7d9c4f794c0d2ddc03;p=collectd.git Merge branch 'collectd-4.10' into collectd-5.0 Conflicts: src/utils_db_query.c src/utils_db_query.h --- 400596160704146845940d7d9c4f794c0d2ddc03 diff --cc src/disk.c index fde0dcde,4a78f1bd..7411c225 --- a/src/disk.c +++ b/src/disk.c @@@ -235,6 -235,16 +235,16 @@@ static void disk_submit (const char *pl plugin_dispatch_values (&vl); } /* void disk_submit */ + #if KERNEL_LINUX + static counter_t disk_calc_time_incr (counter_t delta_time, counter_t delta_ops) + { + double avg_time = ((double) delta_time) / ((double) delta_ops); - double avg_time_incr = ((double) interval_g) * avg_time; ++ double avg_time_incr = CDTIME_T_TO_DOUBLE (interval_g) * avg_time; + + return ((counter_t) (avg_time_incr + .5)); + } + #endif + #if HAVE_IOKIT_IOKITLIB_H static signed long long dict_get_value (CFDictionaryRef dict, const char *key) { diff --cc src/utils_db_query.c index 7e7504dc,675272c0..aadf9c5e --- a/src/utils_db_query.c +++ b/src/utils_db_query.c @@@ -904,10 -1144,10 +904,10 @@@ int udb_query_handle_result (udb_query_ return (0); } /* }}} int udb_query_handle_result */ - int udb_query_prepare_result (const udb_query_t const *q, /* {{{ */ + int udb_query_prepare_result (udb_query_t const *q, /* {{{ */ udb_query_preparation_area_t *prep_area, const char *host, const char *plugin, const char *db_name, - char **column_names, size_t column_num, int interval) + char **column_names, size_t column_num, cdtime_t interval) { udb_result_preparation_area_t *r_area; udb_result_t *r; diff --cc src/utils_db_query.h index 727be036,7856bdbe..b6f4cea0 --- a/src/utils_db_query.h +++ b/src/utils_db_query.h @@@ -65,13 -65,13 +65,13 @@@ void *udb_query_get_user_data (udb_quer */ int udb_query_check_version (udb_query_t *q, unsigned int version); - int udb_query_prepare_result (const udb_query_t const *q, + int udb_query_prepare_result (udb_query_t const *q, udb_query_preparation_area_t *prep_area, const char *host, const char *plugin, const char *db_name, - char **column_names, size_t column_num, int interval); + char **column_names, size_t column_num, cdtime_t interval); - int udb_query_handle_result (const udb_query_t const *q, + int udb_query_handle_result (udb_query_t const *q, udb_query_preparation_area_t *prep_area, char **column_values); - void udb_query_finish_result (const udb_query_t const *q, + void udb_query_finish_result (udb_query_t const *q, udb_query_preparation_area_t *prep_area); udb_query_preparation_area_t *