Commit 238f2081 authored by Kushal Pandya's avatar Kushal Pandya Committed by Kushal Pandya

Use `numberToHumanSize` for memory unit conversion

parent f99be399
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* eslint-disable vue/no-side-effects-in-computed-properties */ /* eslint-disable vue/no-side-effects-in-computed-properties */
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import { parseSeconds, stringifyTime } from '~/lib/utils/pretty_time'; import { parseSeconds, stringifyTime } from '~/lib/utils/pretty_time';
import { bytesToMiB } from '~/lib/utils/number_utils'; import { numberToHumanSize } from '~/lib/utils/number_utils';
import icon from '~/vue_shared/components/icon.vue'; import icon from '~/vue_shared/components/icon.vue';
import { VALUE_TYPE, CUSTOM_TYPE } from '../constants'; import { VALUE_TYPE, CUSTOM_TYPE } from '../constants';
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
return `${this.nodeDetails.version} (${this.nodeDetails.revision})`; return `${this.nodeDetails.version} (${this.nodeDetails.revision})`;
}, },
replicationSlotWAL() { replicationSlotWAL() {
return `${bytesToMiB(this.nodeDetails.replicationSlotWAL)} MB`; return numberToHumanSize(this.nodeDetails.replicationSlotWAL);
}, },
dbReplicationLag() { dbReplicationLag() {
// Replication lag can be nil if the secondary isn't actually streaming // Replication lag can be nil if the secondary isn't actually streaming
......
...@@ -85,7 +85,7 @@ describe('GeoNodeDetailsComponent', () => { ...@@ -85,7 +85,7 @@ describe('GeoNodeDetailsComponent', () => {
describe('replicationSlotWAL', () => { describe('replicationSlotWAL', () => {
it('returns replication slot WAL in Megabytes', () => { it('returns replication slot WAL in Megabytes', () => {
expect(vm.replicationSlotWAL).toBe('0 MB'); expect(vm.replicationSlotWAL).toBe('479.37 MiB');
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment