Class SlowOperationConfig.Builder

java.lang.Object
cloud.opencode.base.log.perf.SlowOperationConfig.Builder
Enclosing class:
SlowOperationConfig

public static final class SlowOperationConfig.Builder extends Object
Builder for SlowOperationConfig. SlowOperationConfig 的构建器。
Since:
JDK 25, opencode-base-log V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • threshold

      public SlowOperationConfig.Builder threshold(Duration threshold)
      Sets the threshold. 设置阈值。
      Parameters:
      threshold - the threshold - 阈值
      Returns:
      this builder - 此构建器
    • thresholdMillis

      public SlowOperationConfig.Builder thresholdMillis(long millis)
      Sets the threshold in milliseconds. 设置毫秒阈值。
      Parameters:
      millis - the threshold in milliseconds - 毫秒阈值
      Returns:
      this builder - 此构建器
    • logLevel

      public SlowOperationConfig.Builder logLevel(LogLevel logLevel)
      Sets the log level. 设置日志级别。
      Parameters:
      logLevel - the log level - 日志级别
      Returns:
      this builder - 此构建器
    • includeStackTrace

      public SlowOperationConfig.Builder includeStackTrace(boolean include)
      Sets whether to include stack trace. 设置是否包含堆栈跟踪。
      Parameters:
      include - true to include - 如果包含则为 true
      Returns:
      this builder - 此构建器
    • enabled

      public SlowOperationConfig.Builder enabled()
      Enables slow operation detection. 启用慢操作检测。
      Returns:
      this builder - 此构建器
    • disabled

      public SlowOperationConfig.Builder disabled()
      Disables slow operation detection. 禁用慢操作检测。
      Returns:
      this builder - 此构建器
    • build

      public SlowOperationConfig build()
      Builds the configuration. 构建配置。
      Returns:
      the config - 配置