Class StatisticsSearcher

  • All Implemented Interfaces:
    com.yahoo.component.Component, java.lang.Comparable<com.yahoo.component.Component>

    public class StatisticsSearcher
    extends Searcher

    A searcher to gather statistics such as queries completed and query latency. There may be more than 1 StatisticsSearcher in the Searcher chain, each identified by a Searcher ID. The statistics accumulated by all StatisticsSearchers are stored in the singleton StatisticsManager object.

    TODO: Fix events to handle more than one of these searchers properly.

    Author:
    Gene Meyers, Steinar Knutsen, bergum
    • Field Summary

      • Fields inherited from class com.yahoo.component.AbstractComponent

        isDeconstructable
    • Constructor Summary

      Constructors 
      Constructor Description
      StatisticsSearcher​(com.yahoo.statistics.Statistics manager, com.yahoo.jdisc.Metric metric, com.yahoo.metrics.simple.MetricReceiver metricReceiver)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deconstruct()  
      Result search​(Query query, Execution execution)
      Generate statistics for the query passing through this Searcher 1) Add 1 to total query count 2) Add response time to total response time (time from entry to return) 3) .....
      • Methods inherited from class com.yahoo.component.chain.ChainedComponent

        getAnnotatedDependencies, getDefaultAnnotatedDependencies, getDependencies, initDependencies
      • Methods inherited from class com.yahoo.component.AbstractComponent

        clone, compareTo, getClassName, getId, getIdString, hasInitializedId, initId, isDeconstructable, setIsDeconstructable
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StatisticsSearcher

        public StatisticsSearcher​(com.yahoo.statistics.Statistics manager,
                                  com.yahoo.jdisc.Metric metric,
                                  com.yahoo.metrics.simple.MetricReceiver metricReceiver)
    • Method Detail

      • deconstruct

        public void deconstruct()
        Overrides:
        deconstruct in class com.yahoo.component.AbstractComponent
      • search

        public Result search​(Query query,
                             Execution execution)
        Generate statistics for the query passing through this Searcher 1) Add 1 to total query count 2) Add response time to total response time (time from entry to return) 3) .....
        Specified by:
        search in class Searcher
        Parameters:
        query - the query
        Returns:
        the result of making this query