Interface Limit.InitializationContext

Enclosing interface:
Limit

public static interface Limit.InitializationContext
Runtime context used when initializing a Limit.
  • Method Details

    • create

      static Limit.InitializationContext create(String originName)
      Create a limit context with no metric tags.
      Parameters:
      originName - origin name of the work protected by the limit
      Returns:
      a new limit context
    • create

      static Limit.InitializationContext create(String originName, List<Tag> metricTags)
      Create a limit context with metric tags.
      Parameters:
      originName - origin name of the work protected by the limit
      metricTags - metric tags to use when registering limit metrics
      Returns:
      a new limit context
    • create

      static Limit.InitializationContext create(String originName, List<Tag> metricTags, Supplier<MeterRegistry> meterRegistry)
      Create a limit context with metric tags and a meter registry supplier.
      Parameters:
      originName - origin name of the work protected by the limit
      metricTags - metric tags to use when registering limit metrics
      meterRegistry - meter registry supplier to use when metrics are enabled
      Returns:
      a new limit context
    • originName

      String originName()
      Origin name of the work protected by the limit.
      Returns:
      origin name
    • metricTags

      List<Tag> metricTags()
      Metric tags to use when registering limit metrics.
      Returns:
      metric tags
    • meterRegistry

      default Optional<MeterRegistry> meterRegistry()
      Meter registry to use when registering limit metrics.
      Returns:
      meter registry to use, if explicitly supplied