Skip to content

Commit

Permalink
Allow disabling duty cycle trackers
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-adaptive committed Dec 19, 2024
1 parent 1bbaf9f commit 729ba8e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions artio-core/src/main/java/uk/co/real_logic/artio/FixCounters.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ public AtomicCounter negativeTimestamps()

public DutyCycleTracker getFramerDutyCycleTracker(final long threshold)
{
if (threshold == 0)
{
return new DutyCycleTracker();
}

return new DutyCycleStallTracker(
newCounter(FRAMER_MAX_CYCLE_TIME_TYPE_ID.id(), "framer max cycle time in ns"),
newCounter(FRAMER_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID.id(),
Expand All @@ -169,6 +174,11 @@ public DutyCycleTracker getFramerDutyCycleTracker(final long threshold)

public DutyCycleTracker getIndexerDutyCycleTracker(final long threshold)
{
if (threshold == 0)
{
return new DutyCycleTracker();
}

return new DutyCycleStallTracker(
newCounter(INDEXER_MAX_CYCLE_TIME_TYPE_ID.id(), "indexer max cycle time in ns"),
newCounter(INDEXER_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID.id(),
Expand All @@ -179,6 +189,11 @@ public DutyCycleTracker getIndexerDutyCycleTracker(final long threshold)

public DutyCycleTracker getLibraryDutyCycleTracker(final int libraryId, final long threshold)
{
if (threshold == 0)
{
return new DutyCycleTracker();
}

return new DutyCycleStallTracker(
newCounter(LIBRARY_MAX_CYCLE_TIME_TYPE_ID.id(), "library " + libraryId + " max cycle time in ns"),
newCounter(LIBRARY_CYCLE_TIME_THRESHOLD_EXCEEDED_TYPE_ID.id(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ public EngineConfiguration cancelOnDisconnectTimeoutWindowInMs(final int cancelO
* Set a threshold for the framer work cycle time which when exceeded it will increment the
* framer cycle time exceeded count.
*
* @param framerCycleThresholdNs value in nanoseconds
* @param framerCycleThresholdNs value in nanoseconds. The value 0 will disable duty cycle tracking on the framer.
* @return this for fluent API.
*/
public EngineConfiguration framerCycleThresholdNs(final long framerCycleThresholdNs)
Expand All @@ -1313,7 +1313,7 @@ public EngineConfiguration framerCycleThresholdNs(final long framerCycleThreshol
* Set a threshold for the indexer work cycle time which when exceeded it will increment the
* indexer cycle time exceeded count.
*
* @param indexerCycleThresholdNs value in nanoseconds
* @param indexerCycleThresholdNs value in nanoseconds. The value 0 will disable duty cycle tracking on the indexer.
* @return this for fluent API.
*/
public EngineConfiguration indexerCycleThresholdNs(final long indexerCycleThresholdNs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public LibraryConfiguration reproduceInbound(
* Set a threshold for the library work cycle time which when exceeded it will increment the
* library cycle time exceeded count.
*
* @param libraryCycleThresholdNs value in nanoseconds
* @param libraryCycleThresholdNs value in nanoseconds. The value 0 will disable duty cycle tracking on the library.
* @return this for fluent API.
*/
public LibraryConfiguration libraryCycleThresholdNs(final long libraryCycleThresholdNs)
Expand Down

0 comments on commit 729ba8e

Please sign in to comment.