Skip to content

Commit

Permalink
relay stats higher interval and duration
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 26, 2024
1 parent 99b8a24 commit c03a9e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/relay/src/main/RelayStatsApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ final class RelayStatsApi(roundRepo: RelayRoundRepo, colls: RelayColls)(using sc
import BSONHandlers.given

// on measurement by minute at most; the storage depends on it.
scheduler.scheduleWithFixedDelay(1 minute, 1 minute)(() => record())
scheduler.scheduleWithFixedDelay(2 minutes, 2 minutes)(() => record())

def get(id: RelayRoundId): Fu[Option[RoundStats]] =
colls.round
Expand Down Expand Up @@ -45,7 +45,7 @@ final class RelayStatsApi(roundRepo: RelayRoundRepo, colls: RelayColls)(using sc
def setActive(id: RelayRoundId) = activeRounds.put(id)

// keep monitoring rounds for some time after they stopped syncing
private val activeRounds = ExpireSetMemo[RelayRoundId](1 hour)
private val activeRounds = ExpireSetMemo[RelayRoundId](2 hours)

private def record(): Funit = for
crowds <- fetchRoundCrowds
Expand Down

0 comments on commit c03a9e8

Please sign in to comment.