diff --git a/www/Utils.js b/www/Utils.js index 2d0993a3..f678a916 100644 --- a/www/Utils.js +++ b/www/Utils.js @@ -247,6 +247,14 @@ Ext.define('PBS.Utils', { }; }, + calculate_dedup_factor: function(gcstatus) { + let dedup = 1.0; + if (gcstatus['disk-bytes'] > 0) { + dedup = (gcstatus['index-data-bytes'] || 0)/gcstatus['disk-bytes']; + } + return dedup; + }, + constructor: function() { var me = this; diff --git a/www/datastore/Summary.js b/www/datastore/Summary.js index ac3f19e2..5c757e8c 100644 --- a/www/datastore/Summary.js +++ b/www/datastore/Summary.js @@ -57,10 +57,7 @@ Ext.define('PBS.DataStoreInfo', { let gcstatus = store.getById('gc-status').data.value; - let dedup = 1.0; - if (gcstatus['disk-bytes'] > 0) { - dedup = (gcstatus['index-data-bytes'] || 0)/gcstatus['disk-bytes']; - } + let dedup = PBS.Utils.calculate_dedup_factor(gcstatus); let countstext = function(count) { count = count || {};