Class RequiredSearch


  • public final class RequiredSearch
    extends java.lang.Object
    Search that requires the search terms are satisfiable, or an MeterNotFoundException is thrown.
    • Method Detail

      • name

        public RequiredSearch name​(java.lang.String exactName)
        Meter contains a tag with the exact name.
        Parameters:
        exactName - Name to match against.
        Returns:
        This search.
      • name

        public RequiredSearch name​(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 RequiredSearch tags​(java.lang.Iterable<Tag> tags)
        Meter contains a tag with the matching tag keys and values.
        Parameters:
        tags - The tags to match.
        Returns:
        This search.
      • tags

        public RequiredSearch tags​(java.lang.String... tags)
        Meter contains a tag 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 RequiredSearch 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 RequiredSearch tagKeys​(java.lang.String... tagKeys)
        Meter contains a tag with the matching keys.
        Parameters:
        tagKeys - The tag keys to match.
        Returns:
        This search.
      • meters

        public java.util.Collection<Meter> meters()
        Returns:
        All matching meters.
        Throws:
        MeterNotFoundException - if there is no match.
      • counters

        public java.util.Collection<Counter> counters()
        Returns:
        All matching Counter meters.
      • gauges

        public java.util.Collection<Gauge> gauges()
        Returns:
        All matching Gauge meters.
      • timers

        public java.util.Collection<Timer> timers()
        Returns:
        All matching Timer meters.
      • timeGauges

        public java.util.Collection<TimeGauge> timeGauges()
        Returns:
        All matching TimeGauge meters.
      • in

        public static RequiredSearch in​(MeterRegistry registry)
        Initiate a new search for meters inside a registry.
        Parameters:
        registry - The registry to locate meters in.
        Returns:
        A new search.