Class FlakeProfiler
java.lang.Object
com.shaft.tools.io.internal.FlakeProfiler
Collects opt-in action timing, wait, retry, locator, healing, and evidence-cost signals.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voidfinishTest(TestExecutionInfo info, String status) Finishes and optionally attaches the current test profile.static booleanReturns whether flake profiling is enabled for the current thread.static voidRecords one completed action boundary.static voidrecordEvidenceCapture(String category, String name, long durationMillis) Records the time spent capturing a report artifact.static voidrecordRetryAttempt(String testName, int attempt, int maxAttempts, boolean supportingEvidenceEnabled) Records a retry attempt and supporting-evidence state.static AssertionErrorWrites the suite-level report and returns a configured severe-risk failure.static voidreset()Clears all profiler state.static voidstartTest(TestExecutionInfo info) Starts a test-scoped profile.
-
Method Details
-
isEnabled
public static boolean isEnabled()Returns whether flake profiling is enabled for the current thread.- Returns:
truewhen profiler collection is enabled
-
reset
public static void reset()Clears all profiler state. -
startTest
Starts a test-scoped profile.- Parameters:
info- test metadata
-
finishTest
Finishes and optionally attaches the current test profile.- Parameters:
info- test metadatastatus- final test status text
-
recordAction
Records one completed action boundary.- Parameters:
sample- action sample to add to the current test profile
-
recordEvidenceCapture
-
recordRetryAttempt
public static void recordRetryAttempt(String testName, int attempt, int maxAttempts, boolean supportingEvidenceEnabled) Records a retry attempt and supporting-evidence state.- Parameters:
testName- test method nameattempt- retry attempt numbermaxAttempts- configured maximum retry attemptssupportingEvidenceEnabled- whether enhanced evidence capture is enabled
-
reportAndGetFailure
Writes the suite-level report and returns a configured severe-risk failure.- Returns:
- assertion error when severe flake risk should fail the run; otherwise
null
-