org.apache.lucene.sandbox.search

## Class ProfilerCollector

- java.lang.Object
- - org.apache.lucene.sandbox.search.ProfilerCollector

- All Implemented Interfaces:
    Collector

      public class ProfilerCollector
      extends 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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProfilerCollector(Collector collector, String reason, List<ProfilerCollector> children)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `LeafCollector` | `getLeafCollector(LeafReaderContext context)`
    `String` | `getName()`
    `ProfilerCollectorResult` | `getProfileResult()`
    `String` | `getReason()`
    `long` | `getTime()`
    `ScoreMode` | `scoreMode()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProfilerCollector

          public ProfilerCollector(Collector collector,
                                   String reason,
                                   List<ProfilerCollector> children)

  - ### Method Detail

    - #### getTime

          public long getTime()

      Returns:
        the profiled time for this collector (inclusive of children)

    - #### getReason

          public String getReason()

      Returns:
        a human readable "hint" about what this collector was used for

    - #### getName

          public String getName()

      Returns:
        the lucene class name of the collector

    - #### getLeafCollector

          public LeafCollector getLeafCollector(LeafReaderContext context)
                                         throws IOException

      Specified by:
        `getLeafCollector` in interface `Collector`
      Throws:
        `IOException`

    - #### scoreMode

          public ScoreMode scoreMode()

      Specified by:
        `scoreMode` in interface `Collector`

    - #### getProfileResult

          public ProfilerCollectorResult getProfileResult()

Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.