Class Search
java.lang.Object
io.micrometer.core.instrument.search.Search
public final class Search
extends java.lang.Object
Search terms for locating a
Meter or set of meters in a given registry based on any combination of their
name, tags, and type.-
Method Summary
Modifier and Type Method Description MeterFilteracceptFilter()Countercounter()java.util.Collection<Counter>counters()FunctionCounterfunctionCounter()java.util.Collection<FunctionCounter>functionCounters()FunctionTimerfunctionTimer()java.util.Collection<FunctionTimer>functionTimers()Gaugegauge()java.util.Collection<Gauge>gauges()static Searchin(MeterRegistry registry)Initiate a new search for meters inside a registry.LongTaskTimerlongTaskTimer()java.util.Collection<LongTaskTimer>longTaskTimers()Metermeter()java.util.Collection<Meter>meters()Searchname(java.lang.String exactName)Meter contains a tag with the exact name.Searchname(java.util.function.Predicate<java.lang.String> nameMatches)Meter contains a tag matching the name predicate.java.util.Collection<DistributionSummary>summaries()DistributionSummarysummary()Searchtag(java.lang.String tagKey, java.lang.String tagValue)Meter contains a tag with the matching key and value.Searchtag(java.lang.String tagKey, java.util.function.Predicate<java.lang.String> tagValueMatches)Meter contains a tag with the provided key and a value matchingtagValueMatches.SearchtagKeys(java.lang.String... tagKeys)Meter contains tags with the matching keys.SearchtagKeys(java.util.Collection<java.lang.String> tagKeys)Meter contains tags with the matching keys.Searchtags(java.lang.Iterable<Tag> tags)Meter contains tags with the matching tag keys and values.Searchtags(java.lang.String... tags)Meter contains tags with the matching tag keys and values.TimeGaugetimeGauge()java.util.Collection<TimeGauge>timeGauges()Timertimer()java.util.Collection<Timer>timers()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
name
Meter contains a tag with the exact name.- Parameters:
exactName- Name to match against.- Returns:
- This search.
-
name
Meter contains a tag matching the name predicate.- Parameters:
nameMatches- Name matching predicate.- Returns:
- This search.
-
tags
Meter contains tags with the matching tag keys and values.- Parameters:
tags- The tags to match.- Returns:
- This search.
-
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
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
Meter contains tags with the matching keys.- Parameters:
tagKeys- The tag keys to match.- Returns:
- This search.
-
tagKeys
Meter contains tags with the matching keys.- Parameters:
tagKeys- The tag keys to match.- Returns:
- This search.
- Since:
- 1.7.0
-
tag
public Search tag(java.lang.String tagKey, java.util.function.Predicate<java.lang.String> tagValueMatches)Meter contains a tag with the provided key and a value matchingtagValueMatches.- Parameters:
tagKey- The tag key to match.tagValueMatches- The test on the tag value.- Returns:
- This search.
- Since:
- 1.6.0
-
timer
- Returns:
- The first matching
Timer, ornullif none match.
-
counter
- Returns:
- The first matching
Counter, ornullif none match.
-
gauge
- Returns:
- The first matching
Gauge, ornullif none match.
-
functionCounter
- Returns:
- The first matching
FunctionCounter, ornullif none match.
-
timeGauge
- Returns:
- The first matching
TimeGauge, ornullif none match.
-
functionTimer
- Returns:
- The first matching
FunctionTimer, ornullif none match.
-
summary
- Returns:
- The first matching
DistributionSummary, ornullif none match.
-
longTaskTimer
- Returns:
- The first matching
LongTaskTimer, ornullif none match.
-
meter
- Returns:
- The first matching
Meter, ornullif none match.
-
meters
- Returns:
- All matching meters, or an empty collection if none match.
-
acceptFilter
- Returns:
- An accept filter that accepts any meter that matches this search.
- Since:
- 1.6.0
-
counters
- Returns:
- All matching
Countermeters.
-
gauges
- Returns:
- All matching
Gaugemeters.
-
timers
- Returns:
- All matching
Timermeters.
-
summaries
- Returns:
- All matching
DistributionSummarymeters.
-
longTaskTimers
- Returns:
- All matching
LongTaskTimermeters.
-
functionCounters
- Returns:
- All matching
FunctionCountermeters.
-
functionTimers
- Returns:
- All matching
FunctionTimermeters.
-
timeGauges
- Returns:
- All matching
TimeGaugemeters.
-
in
Initiate a new search for meters inside a registry.- Parameters:
registry- The registry to locate meters in.- Returns:
- A new search.
-