Skip to content

Commit

Permalink
Merge pull request #1772 from grainier/latency-tracker-fix
Browse files Browse the repository at this point in the history
Fix latency tracker markOuts
  • Loading branch information
senthuran16 authored Mar 18, 2022
2 parents 6124e06 + 8330c51 commit 7ab327e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions modules/siddhi-core/src/main/java/io/siddhi/core/table/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ public void addEvents(ComplexEventChunk<StreamEvent> addingEventChunk, int noOfE
}
addingEventChunk.reset();
add(addingEventChunk);
if (latencyTrackerInsert != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
latencyTrackerInsert.markOut();
}
if (throughputTrackerInsert != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
throughputTrackerInsert.eventsIn(noOfEvents);
Expand Down Expand Up @@ -336,6 +340,10 @@ public void deleteEvents(ComplexEventChunk<StateEvent> deletingEventChunk, Compi
latencyTrackerDelete.markIn();
}
delete(deletingEventChunk, compiledCondition);
if (latencyTrackerDelete != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
latencyTrackerDelete.markOut();
}
if (throughputTrackerDelete != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
throughputTrackerDelete.eventsIn(noOfEvents);
Expand Down Expand Up @@ -415,6 +423,10 @@ public void updateEvents(ComplexEventChunk<StateEvent> updatingEventChunk,
latencyTrackerUpdate.markIn();
}
update(updatingEventChunk, compiledCondition, compiledUpdateSet);
if (latencyTrackerUpdate != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
latencyTrackerUpdate.markOut();
}
if (throughputTrackerUpdate != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
throughputTrackerUpdate.eventsIn(noOfEvents);
Expand Down Expand Up @@ -500,6 +512,10 @@ public void updateOrAddEvents(ComplexEventChunk<StateEvent> updateOrAddingEventC
}
updateOrAdd(updateOrAddingEventChunk, compiledCondition, compiledUpdateSet,
addingStreamEventExtractor);
if (latencyTrackerUpdateOrInsert != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
latencyTrackerUpdateOrInsert.markOut();
}
if (throughputTrackerUpdateOrInsert != null &&
Level.BASIC.compareTo(siddhiAppContext.getRootMetricsLevel()) <= 0) {
throughputTrackerUpdateOrInsert.eventsIn(noOfEvents);
Expand Down

0 comments on commit 7ab327e

Please sign in to comment.