Class AbstractMetrics.Builder<B extends AbstractMetrics.Builder<B,T>,T extends Metrics>

java.lang.Object
io.helidon.pico.api.AbstractMetrics.Builder<B,T>
Type Parameters:
B - the type of the builder
T - the type of the built instance
All Implemented Interfaces:
Builder<B,T>, Metrics, Supplier<T>
Direct Known Subclasses:
DefaultMetrics.Builder
Enclosing class:
AbstractMetrics

public abstract static class AbstractMetrics.Builder<B extends AbstractMetrics.Builder<B,T>,T extends Metrics> extends Object implements Metrics, Builder<B,T>
Fluent API builder for T.
  • Constructor Details

    • Builder

      protected Builder()
      Fluent API builder constructor.
  • Method Details

    • serviceCount

      public Optional<Integer> serviceCount()
      Description copied from interface: Metrics
      The total service count in the registry.
      Specified by:
      serviceCount in interface Metrics
      Returns:
      total service count
    • lookupCount

      public Optional<Integer> lookupCount()
      Description copied from interface: Metrics
      The total number of Services::lookup() calls since jvm start, or since last reset.
      Specified by:
      lookupCount in interface Metrics
      Returns:
      lookup count
    • cacheLookupCount

      public Optional<Integer> cacheLookupCount()
      Description copied from interface: Metrics
      The total number of Services::lookup() calls that were attempted against the lookup cache. This will be empty if caching is disabled.
      Specified by:
      cacheLookupCount in interface Metrics
      Returns:
      cache lookup count
      See Also:
    • cacheHitCount

      public Optional<Integer> cacheHitCount()
      Description copied from interface: Metrics
      The total number of Services:lookup() calls that were successfully resolved via cache. This will be a value less than or equal to Metrics.cacheLookupCount().
      Specified by:
      cacheHitCount in interface Metrics
      Returns:
      cache hit count
    • serviceCount

      public B serviceCount(Optional<Integer> val)
      Setter for 'serviceCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • serviceCount

      public B serviceCount(Integer val)
      Setter for 'serviceCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • lookupCount

      public B lookupCount(Optional<Integer> val)
      Setter for 'lookupCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • lookupCount

      public B lookupCount(Integer val)
      Setter for 'lookupCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • cacheLookupCount

      public B cacheLookupCount(Optional<Integer> val)
      Setter for 'cacheLookupCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • cacheLookupCount

      public B cacheLookupCount(Integer val)
      Setter for 'cacheLookupCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • cacheHitCount

      public B cacheHitCount(Optional<Integer> val)
      Setter for 'cacheHitCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • cacheHitCount

      public B cacheHitCount(Integer val)
      Setter for 'cacheHitCount'.
      Parameters:
      val - the new value
      Returns:
      this fluent builder
    • accept

      public B accept(T val)
      Accept and update from the provided value object.
      Parameters:
      val - the value object to copy from
      Returns:
      this instance typed to correct type
    • visitAttributes

      public <T> void visitAttributes(AttributeVisitor<T> visitor, T userDefinedCtx)
      Visits all attributes of io.helidon.pico.api.Metrics, calling the AttributeVisitor for each.
      Type Parameters:
      T - type of the user defined context
      Parameters:
      visitor - the visitor called for each attribute
      userDefinedCtx - any object you wish to pass to each visit call