문제

Does anyone know if avgTimePerRequest is really in milliseconds? From what I can deduct the value is in seconds?

My current data shows avgTimePerRequest is about 0.095 which would mean a fraction of a millisecond? On the other hand requests divided by total time(in milliseconds i presume!?) - 51831/4968 - yields 10.4. That would be a number quite close to 0.095 if the latter value is in seconds. Would it really make sense that solr is so fast that it can handle a request less than the tenth of a ms and that it could be measurable?

The current stats(from my solr installation):

standard: {
   class: "org.apache.solr.handler.component.SearchHandler",
   version: "$Revision: 1052938 $",
   description: "Search using components:        org.apache.solr.handler.component.QueryComponent,org.apache.solr.handler.component.FacetComponent,org.apache.solr.handler.component.MoreLikeThisComponent,org.apache.solr.handler.component.HighlightComponent,org.apache.solr.handler.component.StatsComponent,org.apache.solr.handler.component.DebugComponent,",
   srcId: "$Id: SearchHandler.java 1052938 2010-12-26 20:21:48Z rmuir $",
   src: "$URL: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene_solr_3_5/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java $",
   docs: null,
   stats: {
          handlerStart: 1400149470564,
          requests: 51831,
          errors: 0,
          timeouts: 0,
          totalTime: 4968,
          avgTimePerRequest: 0.095849976,
          avgRequestsPerSecond: 16.772387
       }
}
도움이 되었습니까?

해결책

avgTimePerRequest is totalTime/requests. In your example totalTime = 4968 and requests = 51831. Do the math and you get 0.09584997 which matches the 0.095849976 in the stats, so avgTimePerRequest is a derived value from the other two members.

Which means that if totalTime is in seconds then avgTimePerRequest is also in seconds.

Make sense?

다른 팁

These values are from org.apache.solr.handler.RequestHandlerBase, which is using org.apache.solr.util.stats.Timer for measuring. Timer has this constructor:

public Timer(TimeUnit durationUnit, TimeUnit rateUnit, Clock clock)

and this default constructor

  public Timer() {
    this(TimeUnit.MILLISECONDS, TimeUnit.SECONDS, Clock.defaultClock());
  }

As you can see the default constructor instantiates the object with MILLISECONDS as durationUnit and SECONDS as rateUnit.

You can confirm this by setting a breakpoint in Timer.Timer(TimeUnit durationUnit, TimeUnit rateUnit, Clock clock).

So totalTime, avgTimePerRequest, medianRequestTime, 75thPcRequestTime, 95thPcRequestTime, 99thPcRequestTime, 999thPcRequestTime are all in ms.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top