MockingStarResponseTimeLogging - #86
Open
mbasakkarahan wants to merge 1 commit into
Open
mbasakkarahan wants to merge 1 commit into
mbasakkarahan wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 > thresholdStart.threshold: CLI option, passed to HTTPServerLogger.Constant.enableConsoleLogging: so the warning also goes to stdout on macOS CLITiming includes decide + responseTime sleep + response build. /search and /scenario are not measured. The macOS app is unchanged.