Class Search
- java.lang.Object
-
- io.micrometer.core.instrument.search.Search
-
public final class Search extends java.lang.Object
Search terms for locating aMeter
or set of meters in a given registry based on any combination of their name, tags, and type.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Counter
counter()
java.util.Collection<Counter>
counters()
FunctionCounter
functionCounter()
java.util.Collection<FunctionCounter>
functionCounters()
FunctionTimer
functionTimer()
java.util.Collection<FunctionTimer>
functionTimers()
Gauge
gauge()
java.util.Collection<Gauge>
gauges()
static Search
in(MeterRegistry registry)
Initiate a new search for meters inside a registry.LongTaskTimer
longTaskTimer()
java.util.Collection<LongTaskTimer>
longTaskTimers()
Meter
meter()
java.util.Collection<Meter>
meters()
Search
name(java.lang.String exactName)
Meter contains a tag with the exact name.Search
name(java.util.function.Predicate<java.lang.String> nameMatches)
Meter contains a tag matching the name predicate.java.util.Collection<DistributionSummary>
summaries()
DistributionSummary
summary()
Search
tag(java.lang.String tagKey, java.lang.String tagValue)
Meter contains a tag with the matching key and value.Search
tagKeys(java.lang.String... tagKeys)
Meter contains tags with the matching keys.Search
tags(java.lang.Iterable<Tag> tags)
Meter contains tags with the matching tag keys and values.Search
tags(java.lang.String... tags)
Meter contains tags with the matching tag keys and values.TimeGauge
timeGauge()
java.util.Collection<TimeGauge>
timeGauges()
Timer
timer()
java.util.Collection<Timer>
timers()
-
-
-
Method Detail
-
name
public Search name(java.lang.String exactName)
Meter contains a tag with the exact name.- Parameters:
exactName
- Name to match against.- Returns:
- This search.
-
name
public Search name(@Nullable java.util.function.Predicate<java.lang.String> nameMatches)
Meter contains a tag matching the name predicate.- Parameters:
nameMatches
- Name matching predicate.- Returns:
- This search.
-
tags
public Search tags(java.lang.Iterable<Tag> tags)
Meter contains tags with the matching tag keys and values.- Parameters:
tags
- The tags to match.- Returns:
- This search.
-
tags
public Search tags(java.lang.String... tags)
Meter contains tags with the matching tag keys and values.- Parameters:
tags
- Must be an even number of arguments representing key/value pairs of tags.- Returns:
- This search.
-
tag
public Search tag(java.lang.String tagKey, java.lang.String tagValue)
Meter contains a tag with the matching key and value.- Parameters:
tagKey
- The tag key to match.tagValue
- The tag value to match.- Returns:
- This search.
-
tagKeys
public Search tagKeys(java.lang.String... tagKeys)
Meter contains tags with the matching keys.- Parameters:
tagKeys
- The tag keys to match.- Returns:
- This search.
-
counter
@Nullable public Counter counter()
- Returns:
- The first matching
Counter
, ornull
if none match.
-
functionCounter
@Nullable public FunctionCounter functionCounter()
- Returns:
- The first matching
FunctionCounter
, ornull
if none match.
-
timeGauge
@Nullable public TimeGauge timeGauge()
- Returns:
- The first matching
TimeGauge
, ornull
if none match.
-
functionTimer
@Nullable public FunctionTimer functionTimer()
- Returns:
- The first matching
FunctionTimer
, ornull
if none match.
-
summary
@Nullable public DistributionSummary summary()
- Returns:
- The first matching
DistributionSummary
, ornull
if none match.
-
longTaskTimer
@Nullable public LongTaskTimer longTaskTimer()
- Returns:
- The first matching
LongTaskTimer
, ornull
if none match.
-
meters
public java.util.Collection<Meter> meters()
- Returns:
- All matching meters, or an empty collection if none match.
-
summaries
public java.util.Collection<DistributionSummary> summaries()
- Returns:
- All matching
DistributionSummary
meters.
-
longTaskTimers
public java.util.Collection<LongTaskTimer> longTaskTimers()
- Returns:
- All matching
LongTaskTimer
meters.
-
functionCounters
public java.util.Collection<FunctionCounter> functionCounters()
- Returns:
- All matching
FunctionCounter
meters.
-
functionTimers
public java.util.Collection<FunctionTimer> functionTimers()
- Returns:
- All matching
FunctionTimer
meters.
-
timeGauges
public java.util.Collection<TimeGauge> timeGauges()
- Returns:
- All matching
TimeGauge
meters.
-
in
public static Search in(MeterRegistry registry)
Initiate a new search for meters inside a registry.- Parameters:
registry
- The registry to locate meters in.- Returns:
- A new search.
-
-