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
IGNITE-14385: Add checkpoit information to performance statistics. #8928
Conversation
...in/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/Checkpointer.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/ignite/internal/processors/cache/persistence/checkpoint/Checkpointer.java
Outdated
Show resolved
Hide resolved
...pache/ignite/internal/processors/cache/persistence/pagemem/PagesWriteSpeedBasedThrottle.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/ignite/internal/processors/performancestatistics/OperationType.java
Outdated
Show resolved
Hide resolved
@@ -120,7 +120,8 @@ | |||
} | |||
}, | |||
() -> true, | |||
new DataRegionMetricsImpl(new DataRegionConfiguration(), cctx.metric(), NO_OP_METRICS), | |||
new DataRegionMetricsImpl(new DataRegionConfiguration(), cctx.metric(), cctx.performanceStatistics(), |
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.
Should we add PerformanceStatistics
instance to ctx on line 68?
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.
done
...nite/internal/processors/cache/persistence/pagemem/BPlusTreeReuseListPageMemoryImplTest.java
Outdated
Show resolved
Hide resolved
.../internal/processors/cache/persistence/pagemem/IgnitePageMemReplaceDelayedWriteUnitTest.java
Outdated
Show resolved
Hide resolved
@@ -135,7 +135,8 @@ | |||
} | |||
}, | |||
() -> true, | |||
new DataRegionMetricsImpl(new DataRegionConfiguration(), cctx.metric(), NO_OP_METRICS), | |||
new DataRegionMetricsImpl( | |||
new DataRegionConfiguration(), cctx.metric(), cctx.performanceStatistics(), NO_OP_METRICS), |
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.
Should we add PerformanceStatistics
instance to ctx on line 68?
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.
done
...rg/apache/ignite/internal/processors/cache/persistence/pagemem/PageMemoryImplNoLoadTest.java
Outdated
Show resolved
Hide resolved
.../apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsProcessor.java
Show resolved
Hide resolved
|
||
MetricRegistry mreg = srv.context().metric().registry(DATASTORAGE_METRIC_PREFIX); | ||
|
||
AtomicLongMetric lastBeforeLockDuration = mreg.findMetric("LastCheckpointBeforeLockDuration"); |
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.
Let's inline all these variables.
@@ -81,6 +82,18 @@ public static void startCollectStatistics() throws Exception { | |||
waitForStatisticsEnabled(true); | |||
} | |||
|
|||
/** Starts collecting performance statistics with immediately flush. */ | |||
protected static void startCollectStatisticsWithImmediatelyFlush() throws Exception { |
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 should get rid of this method.
|
||
forceCheckpoint(); | ||
|
||
assertTrue(waitForCondition(() -> { |
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.
Let's rewrite test as follows:
- Start psproc
- forceCheckpoint
- Wait for checkpoint finish (based on metric value or similar)
- Stop psproc.
- Check is there checkpoint data in statistics (no multiple read of statistics).
AtomicInteger cnt = new AtomicInteger(); | ||
|
||
readFiles(statisticsFiles(), new TestHandler() { | ||
@Override public void checkpoint(UUID nodeId, long beforeLockDuration, long lockWaitDuration, |
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.
Please, fix the code formatting.
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.
fixed
@@ -197,6 +210,20 @@ protected static PerformanceStatisticsMBean statisticsMBean(String igniteInstanc | |||
boolean timedOut) { | |||
// No-op. | |||
} | |||
|
|||
/** {@inheritDoc} */ | |||
@Override public void checkpoint(UUID nodeId, long beforeLockDuration, long lockWaitDuration, |
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.
Please, fix code formatting.
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.
fixed
|
||
startCollectStatisticsWithImmediatelyFlush(); | ||
|
||
int keysCnt = 1024; |
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.
This variables can be inlined.
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.
fixed
private static final long serialVersionUID = 0L; | ||
|
||
/** Default checkpoint park nanos. */ | ||
private static final int CHECKPOINT_PARK_NANOS = 5_000_000; |
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.
This should be long.
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.
fixed
/** | ||
* Create File I/O that emulates poor checkpoint write speed. | ||
*/ | ||
private static class SlowCheckpointFileIOFactory implements FileIOFactory { |
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.
Let's reuse the same class from PagesWriteThrottleSmokeTest
or CheckpointBufferDeadlockTest
instead of copy-pasting it.
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.
fixed
|
||
AtomicLongMetric lastStart = mreg.findMetric("LastCheckpointStart"); | ||
|
||
// wait for checkpoint to finish on node start |
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.
Capital letter on the start and dot in the end.
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.
done
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summary
whereXXXX
- number of JIRA issue.(see the Maintainers list)
the
green visa
attached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.