Skip to content

Commit

Permalink
feat: add disk IO check
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Sep 5, 2024
1 parent e2691b2 commit 7bc62db
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function analyseSamplesTaskFactory(
diskSpace,
fsOpenFiles,
memory,
diskIO,
} = ctx.samples.getSystemInfo();

ctx.systemResourceProblems = verifySystemRequirements(
Expand Down Expand Up @@ -119,7 +120,24 @@ export default function analyseSamplesTaskFactory(
}
},
},
// TODO: Disk IO
{
title: 'Disk IO',
enabled: diskIO?.tWaitPercent,
task: (_ctx, task) => {
const THRESHOLD = 40;

const maxDiskIOWaitPercent = Math.max(
diskIO.rWaitPercent,
diskIO.wWaitPercent,
diskIO.tWaitPercent,
) * 100;

if (maxDiskIOWaitPercent > THRESHOLD) {
ctx.systemResourceProblems.diskIO = `Disk IO wait time is ${maxDiskIOWaitPercent.toFixed(0)}%. Consider to upgrade to faster disk.`;
throw new Error(task.title);
}
},
},
], {
exitOnError: false,
});
Expand Down

0 comments on commit 7bc62db

Please sign in to comment.