diff --git a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java index 293711457bf..a7d0aa0974f 100644 --- a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java +++ b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/BaseUpdateGraph.java @@ -143,11 +143,10 @@ public static class AccumulatedCycleStats { public static final int MAX_DOUBLING_LEN = 1024; synchronized void accumulate( - final long targetCycleDurationMillis, + final boolean onBudget, final long cycleTimeNanos, final long safePoints, final long safePointPauseTimeMillis) { - final boolean onBudget = targetCycleDurationMillis * 1000 * 1000 >= cycleTimeNanos; if (onBudget) { ++cyclesOnBudget; } @@ -788,7 +787,7 @@ void refreshTablesAndFlushNotifications() { private void computeStatsAndLogCycle(final long cycleTimeNanos) { final long safePointPauseTimeMillis = jvmIntrospectionContext.deltaSafePointPausesTimeMillis(); accumulatedCycleStats.accumulate( - getTargetCycleDurationMillis(), + isCycleOnBudget(cycleTimeNanos), cycleTimeNanos, jvmIntrospectionContext.deltaSafePointPausesCount(), safePointPauseTimeMillis); @@ -815,7 +814,6 @@ private void computeStatsAndLogCycle(final long cycleTimeNanos) { } entry = entry.append("ms, lockWaitTime="); entry = appendAsMillisFromNanos(entry, currentCycleLockWaitTotalNanos); - entry = logCycleExtra(entry); entry.append("ms").endl(); return; } @@ -829,17 +827,15 @@ private void computeStatsAndLogCycle(final long cycleTimeNanos) { } } - protected abstract LogEntry logCycleExtra(LogEntry entry); - /** - * Get the target duration of an update cycle, including the updating phase and the idle phase. This is also the - * target interval between the start of one cycle and the start of the next. + * Is the provided cycle time on budget? + * + * @param cycleTimeNanos the cycle time, in nanoseconds * - * @return The target cycle duration + * @return true if the cycle time is within the desired budget */ - public long getTargetCycleDurationMillis() { - // TODO: REMOVE THIS FROM THE BASE AND KEEP ONLY IN THE MAIN - return 0; + public boolean isCycleOnBudget(long cycleTimeNanos) { + return true; } private void logSuppressedCycles() { diff --git a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/EventDrivenUpdateGraph.java b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/EventDrivenUpdateGraph.java index eb03e8ff65c..c277b5bdb59 100644 --- a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/EventDrivenUpdateGraph.java +++ b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/EventDrivenUpdateGraph.java @@ -41,11 +41,6 @@ public LogOutput append(@NotNull final LogOutput logOutput) { return logOutput.append("EventDrivenUpdateGraph-").append(getName()); } - @Override - protected LogEntry logCycleExtra(LogEntry entry) { - return entry; - } - @Override public int parallelismFactor() { return 1; diff --git a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/PeriodicUpdateGraph.java b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/PeriodicUpdateGraph.java index 20f43127b3c..208e4dfe4aa 100644 --- a/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/PeriodicUpdateGraph.java +++ b/engine/table/src/main/java/io/deephaven/engine/updategraph/impl/PeriodicUpdateGraph.java @@ -15,7 +15,6 @@ import io.deephaven.engine.updategraph.*; import io.deephaven.engine.util.systemicmarking.SystemicObjectTracker; import io.deephaven.internal.log.LoggerFactory; -import io.deephaven.io.log.LogEntry; import io.deephaven.io.logger.Logger; import io.deephaven.util.SafeCloseable; import io.deephaven.util.annotations.TestUseOnly; @@ -100,17 +99,6 @@ public static Builder newBuilder(final String name) { private final long defaultTargetCycleDurationMillis; private volatile long targetCycleDurationMillis; - /** - * Accumulated delays due to intracycle yields for the current cycle (or previous, if idle). - */ - // TODO: WHY UNUSED? - private long currentCycleYieldTotalNanos; - /** - * Accumulated delays due to intracycle sleeps for the current cycle (or previous, if idle). - */ - private long currentCycleSleepTotalNanos; - - /** * The number of threads in our executor service for dispatching notifications. If 1, then we don't actually use the * executor service; but instead dispatch all the notifications on the PeriodicUpdateGraph run thread. @@ -261,6 +249,11 @@ public long getTargetCycleDurationMillis() { return targetCycleDurationMillis; } + @Override + public boolean isCycleOnBudget(long cycleTimeNanos) { + return cycleTimeNanos <= MILLISECONDS.toNanos(targetCycleDurationMillis); + } + /** * Resets the run cycle time to the default target configured via the {@link Builder} setting. * @@ -929,16 +922,6 @@ int threadCount() { } } - @Override - protected LogEntry logCycleExtra(LogEntry entry) { - entry.append("ms, yieldTime="); - entry = appendAsMillisFromNanos(entry, currentCycleYieldTotalNanos); - entry = entry.append("ms, sleepTime="); - entry = appendAsMillisFromNanos(entry, currentCycleSleepTotalNanos); - return entry; - } - - @TestUseOnly private class ControlledNotificationProcessor implements NotificationProcessor {