-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(PDiskSpaceDistribution): update slots severity calculation #1907
Conversation
const usagePercent = (Number(LogUsedSize) * 100) / Number(LogTotalSize); | ||
|
||
logSlot = { | ||
SlotType: 'log', | ||
Used: Number(LogUsedSize), | ||
Total: Number(LogTotalSize), | ||
UsagePercent: (Number(LogUsedSize) * 100) / Number(LogTotalSize), | ||
Severity: 1, | ||
UsagePercent: usagePercent, | ||
Severity: getSpaceSeverity(usagePercent), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Colorize log just like other slots. For example, if log is 90/100, it should be yellow, if 99/100 - red.
const slotSeverity = Math.max( | ||
getSpaceSeverity(preparedVDisk.AllocatedPercent), | ||
preparedVDisk.Severity || 0, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use allocated percent to get vdisks severity inside prepare functions, we use it only here while preparing slots
@@ -78,7 +89,7 @@ export function preparePDiskDataResponse([pdiskResponse = {}, nodeResponse]: [ | |||
if (ExpectedSlotCount && ExpectedSlotCount > vdisksSlots.length) { | |||
const emptySlotsCount = ExpectedSlotCount - vdisksSlots.length; | |||
|
|||
let emptySlotSize = Number(EnforcedDynamicSlotSize); | |||
let emptySlotSize = Number(SlotSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a bug, added tests
@@ -17,13 +10,13 @@ export function calculatePDiskSeverity< | |||
}, | |||
>(pDisk: T) { | |||
const stateSeverity = getStateSeverity(pDisk.State); | |||
const spaceSeverityFlag = getUsageSeverityForPDisk(pDisk.AllocatedPercent || 0); | |||
const spaceSeverity = getSpaceSeverity(pDisk.AllocatedPercent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just little refactoring
8ffde21
to
b3c29d5
Compare
Closes #1812
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
😟 No changes in tests. 😕
Bundle Size: ✅
Current: 80.20 MB | Main: 80.19 MB
Diff: +0.90 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information