Skip to content

feat(server): add -stats-interval flag#5

Open
TheHuman00 wants to merge 2 commits into
tannerryan:mainfrom
TheHuman00:feat/stats-interval-flag
Open

feat(server): add -stats-interval flag#5
TheHuman00 wants to merge 2 commits into
tannerryan:mainfrom
TheHuman00:feat/stats-interval-flag

Conversation

@TheHuman00
Copy link
Copy Markdown

I run this server on my own infrastructure and the default 60s stats log cadence is too frequent for my setup. This adds a -stats-interval flag to make it configurable.

Changes

  • New -stats-interval flag (default 60s)
  • statsLoop reads the flag directly, instead of a separate global variable
  • Validation rejects zero/negative values
  • README and tests updated

Thanks for maintaining this project, I use it daily and it works great. 😄

Copilot AI review requested due to automatic review settings May 24, 2026 17:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a configurable stats logging cadence to the roughtime server by promoting the interval to a CLI flag and wiring it through runtime behavior and validation.

Changes:

  • Introduces -stats-interval duration flag with validation for positive values.
  • Updates statsLoop and server config logging to use the flag value.
  • Updates tests and README to reflect the new flag behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
cmd/roughtime/main.go Adds -stats-interval flag, validates it, and logs configured value.
cmd/roughtime/stats.go Switches periodic ticker/logging to use the flag-backed interval.
cmd/roughtime/stats_test.go Updates interval override to target the flag-backed duration.
cmd/roughtime/main_test.go Ensures flag global statsIntervalFlag is restored after tests.
cmd/roughtime/bootstrap_test.go Adds validation tests for zero/negative stats interval.
README.md Documents the new -stats-interval flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/roughtime/stats.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants