allow load to be a float

This commit is contained in:
M. Kory Woods 2013-07-07 10:54:50 -05:00 committed by Michael Stapelberg
parent cf417ffeb1
commit 41be50a983
3 changed files with 4 additions and 4 deletions

View File

@ -261,7 +261,7 @@ int main(int argc, char *argv[]) {
cfg_opt_t load_opts[] = {
CFG_STR("format", "%1min %5min %15min", CFGF_NONE),
CFG_INT("max_threshold", 5, CFGF_NONE),
CFG_FLOAT("max_threshold", 5, CFGF_NONE),
CFG_CUSTOM_COLOR_OPTS,
CFG_END()
};
@ -488,7 +488,7 @@ int main(int argc, char *argv[]) {
CASE_SEC("load") {
SEC_OPEN_MAP("load");
print_load(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getint(sec, "max_threshold"));
print_load(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getfloat(sec, "max_threshold"));
SEC_CLOSE_MAP;
}

View File

@ -152,7 +152,7 @@ void print_run_watch(yajl_gen json_gen, char *buffer, const char *title, const c
void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const char *path, const char *format, int);
void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format);
void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down);
void print_load(yajl_gen json_gen, char *buffer, const char *format, const int max_threshold);
void print_load(yajl_gen json_gen, char *buffer, const char *format, const float max_threshold);
void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *device, const char *mixer, int mixer_idx);
bool process_runs(const char *path);

View File

@ -6,7 +6,7 @@
#include <yajl/yajl_gen.h>
#include <yajl/yajl_version.h>
void print_load(yajl_gen json_gen, char *buffer, const char *format, const int max_threshold) {
void print_load(yajl_gen json_gen, char *buffer, const char *format, const float max_threshold) {
char *outwalk = buffer;
/* Get load */