1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-14 11:33:14 +00:00

Fix diskio graph scale being 3 orders of magnitude too small

This commit is contained in:
missing-semi-colon 2021-10-04 19:02:13 +01:00 committed by Brenden Matthews
parent 1954893eaf
commit c834e91a77

View File

@ -153,7 +153,7 @@ static void print_diskio_dir(struct text_object *obj, int dir, char *p,
/* TODO: move this correction from kB to kB/s elsewhere /* TODO: move this correction from kB to kB/s elsewhere
* (or get rid of it??) */ * (or get rid of it??) */
human_readable((val / active_update_interval()) * 1024LL, p, p_max_size); human_readable(val / active_update_interval(), p, p_max_size);
} }
void print_diskio(struct text_object *obj, char *p, unsigned int p_max_size) { void print_diskio(struct text_object *obj, char *p, unsigned int p_max_size) {
@ -219,9 +219,9 @@ void update_diskio_values(struct diskio_stat *ds, unsigned int reads,
/* compute averages */ /* compute averages */
int samples = diskio_avg_samples.get(*state); int samples = diskio_avg_samples.get(*state);
for (i = 0; i < samples; i++) { for (i = 0; i < samples; i++) {
sum += ds->sample[i]; sum += ds->sample[i] * 1024LL;
sum_r += ds->sample_read[i]; sum_r += ds->sample_read[i] * 1024LL;
sum_w += ds->sample_write[i]; sum_w += ds->sample_write[i] * 1024LL;
} }
ds->current = sum / static_cast<double>(samples); ds->current = sum / static_cast<double>(samples);
ds->current_read = sum_r / static_cast<double>(samples); ds->current_read = sum_r / static_cast<double>(samples);