Skip to content

Commit

Permalink
EventDrivenUpdateGraph. (#4613)
Browse files Browse the repository at this point in the history
* EventDrivenUpdateGraph.

* bad import

* Comment on PoisonedNotificationProcessor.

* running into state problems.

* rename stuff

* move graph name collision check into base.

* test, but in an impossible place

* Use EDUG for default.

* flush reset

* also clear on end

* some comments

* spotless

* self-review.

* rset UPT.

* live code review comments to address.

* cleanup

* spotless

* javadoc

* Cleanup of unused variables, move budget calculation.

* Fix existingOrBuild.

* speling.

* Apply suggestions from code review

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>

---------

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
  • Loading branch information
cpwright and rcaudy committed Dec 5, 2023
1 parent 771e735 commit 374188a
Show file tree
Hide file tree
Showing 10 changed files with 1,623 additions and 966 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@ public boolean supportsRefreshing() {
public void requestRefresh() {
fail();
}

@Override
public void stop() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
import io.deephaven.engine.tablelogger.EngineTableLoggers;
import io.deephaven.engine.tablelogger.UpdatePerformanceLogLogger;
import io.deephaven.engine.updategraph.UpdateGraph;
import io.deephaven.engine.updategraph.impl.PeriodicUpdateGraph;
import io.deephaven.engine.updategraph.impl.BaseUpdateGraph;
import io.deephaven.engine.util.string.StringUtils;
import io.deephaven.internal.log.LoggerFactory;
import io.deephaven.io.logger.Logger;
import io.deephaven.stream.StreamToBlinkTableAdapter;
import io.deephaven.util.QueryConstants;
import io.deephaven.util.SafeCloseable;
import io.deephaven.util.annotations.TestUseOnly;
import org.apache.commons.lang3.mutable.MutableObject;
import org.jetbrains.annotations.NotNull;

Expand All @@ -37,7 +38,7 @@

/**
* <p>
* This tool is meant to track periodic update events that take place in an {@link PeriodicUpdateGraph}. This generally
* This tool is meant to track periodic update events that take place in an {@link UpdateGraph}. This generally
* includes:
* <ol>
* <li>Update source {@code run()} invocations</li>
Expand Down Expand Up @@ -88,8 +89,8 @@ private static class InternalState {

private InternalState() {
final UpdateGraph publishingGraph =
PeriodicUpdateGraph.getInstance(PeriodicUpdateGraph.DEFAULT_UPDATE_GRAPH_NAME);
Assert.neqNull(publishingGraph, "The " + PeriodicUpdateGraph.DEFAULT_UPDATE_GRAPH_NAME + " UpdateGraph "
BaseUpdateGraph.getInstance(BaseUpdateGraph.DEFAULT_UPDATE_GRAPH_NAME);
Assert.neqNull(publishingGraph, "The " + BaseUpdateGraph.DEFAULT_UPDATE_GRAPH_NAME + " UpdateGraph "
+ "must be created before UpdatePerformanceTracker can be initialized.");
try (final SafeCloseable ignored = ExecutionContext.getContext().withUpdateGraph(publishingGraph).open()) {
tableLogger = EngineTableLoggers.get().updatePerformanceLogLogger();
Expand Down Expand Up @@ -286,4 +287,11 @@ public long getIntervalEndTimeEpochNanos() {
public static QueryTable getQueryTable() {
return (QueryTable) BlinkTableTools.blinkToAppendOnly(getInternalState().blink);
}

@TestUseOnly
public static void resetForUnitTests() {
synchronized (UpdatePerformanceTracker.class) {
INSTANCE = null;
}
}
}
Loading

0 comments on commit 374188a

Please sign in to comment.