sashapolo commented on code in PR #5637: URL: https://github.com/apache/ignite-3/pull/5637#discussion_r2044494732
########## modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/persistence/throttling/SpeedBasedMemoryConsumptionThrottlingStrategy.java: ########## @@ -496,5 +506,35 @@ void reset() { void finish() { cpWriteSpeed.closeInterval(); threadIds.clear(); + + updateWriteVsFsyncCoefficient(); + } + + private void updateWriteVsFsyncCoefficient() { + CheckpointProgress progress = cpProgress.get(); + assert progress != null; + + if (progress.currentCheckpointPagesCount() == 0) { + return; + } + + long pagesWriteTimeMillis = progress.getPagesWriteTimeMillis(); + long fsyncTimeMillis = progress.getFsyncTimeMillis(); + + double coefficient = ((double) pagesWriteTimeMillis) / (pagesWriteTimeMillis + fsyncTimeMillis); + if (isNaN(coefficient)) { + return; + } + + double newCoefficient = writeVsFsyncCoefficient * 0.85 + coefficient * 0.15; + + // Put it within reasonable bounds just in case. Review Comment: Why? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org