mirror of
https://github.com/ceph/ceph
synced 2025-01-13 06:22:51 +00:00
Merge pull request #43905 from rhcs-dashboard/fix-53242-master
mgr/dashboard: dashboard does not show degraded objects if they are less than 0.5% under "Dashboard->Capacity->Objects block Reviewed-by: Aashish Sharma <aasharma@redhat.com> Reviewed-by: Avan Thakkar <athakkar@redhat.com> Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
This commit is contained in:
commit
9623700e7e
@ -340,8 +340,9 @@ describe('HealthComponent', () => {
|
||||
expect(component['calcPercentage'](undefined, 1)).toEqual(0);
|
||||
expect(component['calcPercentage'](null, 1)).toEqual(0);
|
||||
expect(component['calcPercentage'](0, 1)).toEqual(0);
|
||||
expect(component['calcPercentage'](2.346, 10)).toEqual(23);
|
||||
expect(component['calcPercentage'](2.35, 10)).toEqual(24);
|
||||
expect(component['calcPercentage'](1, 100000)).toEqual(0.01);
|
||||
expect(component['calcPercentage'](2.346, 10)).toEqual(23.46);
|
||||
expect(component['calcPercentage'](2.56, 10)).toEqual(25.6);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -249,6 +249,6 @@ export class HealthComponent implements OnInit, OnDestroy {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Math.round((dividend / divisor) * 100);
|
||||
return Math.ceil((dividend / divisor) * 100 * 100) / 100;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user