Class ProfilerCollector

  • All Implemented Interfaces:
    Collector

    public class ProfilerCollector
    extends java.lang.Object
    implements Collector
    This class wraps a Collector and times the execution of: - setScorer() - collect() - doSetNextReader() - needsScores()

    QueryProfiler facilitates the linking of the Collector graph

    • Field Detail

      • collectorName

        private final java.lang.String collectorName
        A more friendly representation of the Collector's class name
      • reason

        private final java.lang.String reason
        A "hint" to help provide some context about this Collector
      • children

        private final java.util.List<ProfilerCollector> children
        A list of "embedded" children collectors
    • Constructor Detail

      • ProfilerCollector

        public ProfilerCollector​(Collector collector,
                                 java.lang.String reason,
                                 java.util.List<ProfilerCollector> children)
    • Method Detail

      • getTime

        public long getTime()
        Returns:
        the profiled time for this collector (inclusive of children)
      • getReason

        public java.lang.String getReason()
        Returns:
        a human readable "hint" about what this collector was used for
      • getName

        public java.lang.String getName()
        Returns:
        the lucene class name of the collector
      • deriveCollectorName

        protected java.lang.String deriveCollectorName​(Collector c)
        Creates a human-friendly representation of the Collector name. Override to customize how the name is derived.
        Parameters:
        c - The Collector to derive a name from
        Returns:
        A (hopefully) prettier name
      • scoreMode

        public ScoreMode scoreMode()
        Description copied from interface: Collector
        Indicates what features are required from the scorer.
        Specified by:
        scoreMode in interface Collector