Skip to content

Commit

Permalink
test if the scheduler can run every millisecond - REVERT ME eventually
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Sep 26, 2024
1 parent aa78adb commit 34da272
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/scala/Monitor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,4 @@ object Monitor:
val maxDelay = Kamon.gauge("connector.flush.config.maxDelay").withoutTags()
val qSize = Kamon.histogram("connector.flush.qSize").withoutTags()
val channelsToFlush = Kamon.histogram("connector.flush.channelsToFlush").withoutTags()
val scheduledHit = Kamon.counter("connector.scheduledHit").withoutTags()
5 changes: 5 additions & 0 deletions src/main/scala/netty/ActorChannelConnector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,8 @@ final private class ActorChannelConnector(
else if flushQ.isEmpty then 1.second // hibernate
else 1.millis // interval is 0 but we still need to empty the queue
scheduler.scheduleOnce(nextInterval, () => flush())

def scheduledHit(): Unit =
Monitor.connector.scheduledHit.increment()
scheduler.scheduleOnce(1 millis, () => scheduledHit())
scheduledHit()

0 comments on commit 34da272

Please sign in to comment.