Class BenchmarkException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.test.exception.TestException
cloud.opencode.base.test.exception.BenchmarkException
- All Implemented Interfaces:
Serializable
Benchmark Exception - Exception thrown during benchmark execution
基准测试异常 - 基准测试执行期间抛出的异常
This exception is thrown when benchmark execution fails.
当基准测试执行失败时抛出此异常。
Features | 主要功能:
- Benchmark execution failure reporting - 基准测试执行失败报告
- Benchmark timeout reporting - 基准测试超时报告
- Factory methods for common benchmark errors - 常见基准测试错误的工厂方法
Usage Examples | 使用示例:
throw BenchmarkException.executionFailed("sortBenchmark", cause);
throw BenchmarkException.timeout("sortBenchmark", 30000);
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Null-safe: Yes - 空值安全: 是
- Since:
- JDK 25, opencode-base-test V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBenchmarkException(TestErrorCode errorCode) Creates benchmark exception with error code.BenchmarkException(TestErrorCode errorCode, String detail) Creates benchmark exception with error code and detail.BenchmarkException(String message) Creates benchmark exception with message.BenchmarkException(String message, Throwable cause) Creates benchmark exception with message and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic BenchmarkExceptionexecutionFailed(String benchmarkName, Throwable cause) Creates exception for benchmark execution failure.static BenchmarkExceptionCreates exception for benchmark timeout.Methods inherited from class TestException
getTestErrorCodeMethods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
BenchmarkException
Creates benchmark exception with error code. 使用错误码创建基准测试异常。- Parameters:
errorCode- the error code | 错误码
-
BenchmarkException
Creates benchmark exception with error code and detail. 使用错误码和详情创建基准测试异常。- Parameters:
errorCode- the error code | 错误码detail- the detail message | 详细消息
-
BenchmarkException
Creates benchmark exception with message. 使用消息创建基准测试异常。- Parameters:
message- the message | 消息
-
BenchmarkException
-
-
Method Details
-
executionFailed
Creates exception for benchmark execution failure. 为基准测试执行失败创建异常。- Parameters:
benchmarkName- the benchmark name | 基准测试名称cause- the cause | 原因- Returns:
- the exception | 异常
-
timeout
Creates exception for benchmark timeout. 为基准测试超时创建异常。- Parameters:
benchmarkName- the benchmark name | 基准测试名称timeoutMs- the timeout in milliseconds | 超时毫秒数- Returns:
- the exception | 异常
-