From e3efaa1972cd4fa737b634b885a0929950d5b17d Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 23 Jun 2020 10:30:15 +0200 Subject: [PATCH] ui: fix undefined data for iodelay if ios are 0 and io_ticks are defined, the io_delay is zero Signed-off-by: Dominik Csapak --- www/DataStoreStatistic.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/www/DataStoreStatistic.js b/www/DataStoreStatistic.js index 3c54fc80..a3b8b4c0 100644 --- a/www/DataStoreStatistic.js +++ b/www/DataStoreStatistic.js @@ -13,8 +13,10 @@ Ext.define('pve-rrd-datastore', { let ios = 0; if (data.read_ios !== undefined) { ios += data.read_ios; } if (data.write_ios !== undefined) { ios += data.write_ios; } - if (ios == 0 || data.io_ticks === undefined) { + if (data.io_ticks === undefined) { return undefined; + } else if (ios === 0) { + return 0; } return (data.io_ticks*1000.0)/ios; }