Skip to content
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

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

artemmufazalov
Copy link
Member

@artemmufazalov artemmufazalov commented Feb 4, 2025

Closes #1812

CI Results

Test Status: ⚠️ FLAKY

📊 Full Report

Total Passed Failed Flaky Skipped
262 260 0 2 0

😟 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
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

Comment on lines +44 to +51
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),
Copy link
Member Author

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.

Comment on lines +69 to +72
const slotSeverity = Math.max(
getSpaceSeverity(preparedVDisk.AllocatedPercent),
preparedVDisk.Severity || 0,
);
Copy link
Member Author

@artemmufazalov artemmufazalov Feb 4, 2025

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);
Copy link
Member Author

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);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just little refactoring

@artemmufazalov artemmufazalov force-pushed the 1812-pdisk-space-distribution branch from 8ffde21 to b3c29d5 Compare February 4, 2025 13:28
@artemmufazalov artemmufazalov added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit 0a49720 Feb 6, 2025
7 checks passed
@artemmufazalov artemmufazalov deleted the 1812-pdisk-space-distribution branch February 6, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update severity calculation for VDisks inside PDisk space distribution
2 participants