mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-12 14:56:08 +02:00
[Issue #139] fix incorrect "Zratio" calculation in show --archive
This commit is contained in:
parent
3d4c2f23e5
commit
8134a6866f
@ -835,7 +835,7 @@ show_archive_plain(const char *instance_name, uint32 xlog_seg_size,
|
||||
|
||||
/* Zratio (compression ratio) */
|
||||
if (tlinfo->size != 0)
|
||||
zratio = (float) ((xlog_seg_size*tlinfo->n_xlog_files)/tlinfo->size);
|
||||
zratio = ((float)xlog_seg_size*tlinfo->n_xlog_files) / tlinfo->size;
|
||||
|
||||
snprintf(row->zratio, lengthof(row->n_segments), "%.2f", zratio);
|
||||
widths[cur] = Max(widths[cur], strlen(row->zratio));
|
||||
@ -1003,7 +1003,7 @@ show_archive_json(const char *instance_name, uint32 xlog_seg_size,
|
||||
|
||||
json_add_key(buf, "zratio", json_level);
|
||||
if (tlinfo->size != 0)
|
||||
zratio = (float) ((xlog_seg_size*tlinfo->n_xlog_files)/tlinfo->size);
|
||||
zratio = ((float)xlog_seg_size*tlinfo->n_xlog_files) / tlinfo->size;
|
||||
appendPQExpBuffer(buf, "%.2f", zratio);
|
||||
|
||||
if (tlinfo->closest_backup != NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user