Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gatsbyz committed Nov 6, 2023
1 parent d042925 commit 69005fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/monitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func appendOlderBlocks(ctx context.Context, ms *monitorStatus, rpc *ethrpc.Clien
return nil
}

const maxHistoricalPoints = 1000 // Set a limit to the number of historical points
const maxHistoricalPoints = 1000 // set a limit to the number of historical points

func fetchBlocks(ctx context.Context, ec *ethclient.Client, ms *monitorStatus, rpc *ethrpc.Client, isUiRendered bool) (err error) {
var cs *chainState
Expand All @@ -235,7 +235,7 @@ func fetchBlocks(ctx context.Context, ec *ethclient.Client, ms *monitorStatus, r
return err
}
if len(observedPendingTxs) >= maxHistoricalPoints {
// Remove the oldest data point
// remove the oldest data point
observedPendingTxs = observedPendingTxs[1:]
}
observedPendingTxs = append(observedPendingTxs, historicalDataPoint{SampleTime: time.Now(), SampleValue: float64(cs.PendingCount)})
Expand Down

0 comments on commit 69005fb

Please sign in to comment.