mirror of
https://github.com/ceph/ceph
synced 2025-02-24 11:37:37 +00:00
Merge pull request #38720 from bk201/wip-48717
mgr/dashboard: fix Reads/Writes ratio of Clients IOPS donut chart Reviewed-by: Avan Thakkar <athakkar@redhat.com> Reviewed-by: Laura Paduano <lpaduano@suse.com> Reviewed-by: Nizamudeen A <nia@redhat.com> Reviewed-by: Volker Theile <vtheile@suse.com>
This commit is contained in:
commit
ad5f10edba
@ -218,15 +218,16 @@ describe('HealthComponent', () => {
|
||||
});
|
||||
|
||||
it('event binding "prepareReadWriteRatio" is called', () => {
|
||||
const prepareReadWriteRatio = spyOn(component, 'prepareReadWriteRatio');
|
||||
const prepareReadWriteRatio = spyOn(component, 'prepareReadWriteRatio').and.callThrough();
|
||||
|
||||
const payload = _.cloneDeep(healthPayload);
|
||||
payload.client_perf['read_op_per_sec'] = 1;
|
||||
payload.client_perf['write_op_per_sec'] = 1;
|
||||
payload.client_perf['write_op_per_sec'] = 3;
|
||||
getHealthSpy.and.returnValue(of(payload));
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(prepareReadWriteRatio).toHaveBeenCalled();
|
||||
expect(prepareReadWriteRatio.calls.mostRecent().args[0].dataset[0].data).toEqual([25, 75]);
|
||||
});
|
||||
|
||||
it('event binding "prepareRawUsage" is called', () => {
|
||||
|
@ -92,7 +92,7 @@ export class HealthComponent implements OnInit, OnDestroy {
|
||||
this.healthData.client_perf.read_op_per_sec
|
||||
)} ${$localize`/s`}`
|
||||
);
|
||||
ratioData.push(this.healthData.client_perf.read_op_per_sec);
|
||||
ratioData.push(this.calcPercentage(this.healthData.client_perf.read_op_per_sec, total));
|
||||
ratioLabels.push(
|
||||
`${$localize`Writes`}: ${this.dimless.transform(
|
||||
this.healthData.client_perf.write_op_per_sec
|
||||
|
Loading…
Reference in New Issue
Block a user