Module org.mule.metrics.api
Interface LongUpDownCounterBuilder
- All Superinterfaces:
InstrumentBuilder<LongUpDownCounter>
Builder class for
LongUpDownCounter.- Since:
- 4.5.0
-
Method Summary
Modifier and TypeMethodDescriptionwithConsumerForAddOperation(Consumer<Long> consumerForAddOperation) withInitialValue(long initialValue) Sets the initial value for the instrument to build.withSupplierForDecrementAndGetOperation(Supplier<Long> supplierForDecrementAndGetOperation) withSupplierForIncrementAndGetOperation(Supplier<Long> supplierForIncrementAndGetOperation) withValueSupplier(Supplier<Long> valueSupplier) Methods inherited from interface org.mule.metrics.api.instrument.builder.InstrumentBuilder
build, withDescription, withUnit
-
Method Details
-
withInitialValue
Sets the initial value for the instrument to build.- Parameters:
initialValue- the initial value.- Returns:
- the
LongCounterBuilder.
-
withConsumerForAddOperation
- Parameters:
consumerForAddOperation- theConsumerto be invoked when theLongUpDownCounter.add(long)is invoked.- Returns:
LongUpDownCounterBuilder.
-
withSupplierForIncrementAndGetOperation
LongUpDownCounterBuilder withSupplierForIncrementAndGetOperation(Supplier<Long> supplierForIncrementAndGetOperation) - Parameters:
supplierForIncrementAndGetOperation- theSupplierto be used whenLongUpDownCounter.incrementAndGetAsInt()andLongUpDownCounter.incrementAndGetAsLong()are invoked.- Returns:
- the
LongUpDownCounterBuilder.
-
withSupplierForDecrementAndGetOperation
LongUpDownCounterBuilder withSupplierForDecrementAndGetOperation(Supplier<Long> supplierForDecrementAndGetOperation) - Parameters:
supplierForDecrementAndGetOperation- theSupplierto be used whenLongUpDownCounter.decrementAndGetAsInt()()} andLongUpDownCounter.decrementAndGetAsLong()are invoked.- Returns:
- the
LongUpDownCounterBuilder.
-
withValueSupplier
- Parameters:
valueSupplier- the valueSupplierto invoke whenLongCounter.getValueAsLong()andLongCounter.getValueAsInt()are invoked.- Returns:
- the corresponding
LongUpDownCounterBuilder
-