Skip to content

MockingStarResponseTimeLogging - #86

Open
mbasakkarahan wants to merge 1 commit into
mainfrom
MockingStarResponseTimeLogging
Open

mbasakkarahan wants to merge 1 commit into
mainfrom
MockingStarResponseTimeLogging

Conversation

@mbasakkarahan

Copy link
Copy Markdown

Summary

Snapshot timeouts in CI often happen because MockingStar is slow to respond. The CLI now measures each /mock request and logs a warning when it exceeds the threshold. The response is unchanged; tests are not failed. CLI only.

Usage

./MockingStar start [--threshold <seconds>] <folder>
Default is 0.2s (typical mock responseTime is 0.15s, plus a small processing buffer). Override with -t / --threshold.

WARNING Mock response exceeded threshold: 0.42s (threshold: 0.20s) GET https://...

What Changed

TimedMockHandler.handle : wraps MockingStarCore, measures wall-clock time with ContinuousClock, logs a warning if duration > threshold
Start.threshold : CLI option, passed to HTTPServer
Logger.Constant.enableConsoleLogging : so the warning also goes to stdout on macOS CLI

Timing includes decide + responseTime sleep + response build. /search and /scenario are not measured. The macOS app is unchanged.

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.

1 participant