Fix indexing latency instrumentation.

Change-Id: I532c170121cd2996d1a378adbb1fd551cd5a4e38
This commit is contained in:
Julius Volz 2014-09-24 17:18:48 +02:00 committed by Bjoern Rabenstein
parent 01dd618a20
commit df1b2a2422

View File

@ -710,9 +710,10 @@ func (p *diskPersistence) processIndexingQueue() {
defer batchTimeout.Stop()
commitBatch := func() {
begin := time.Now()
defer p.indexingBatchLatency.Observe(float64(time.Since(begin) / time.Millisecond))
p.indexingBatchSizes.Observe(float64(batchSize))
defer func(begin time.Time) {
p.indexingBatchLatency.Observe(float64(time.Since(begin) / time.Millisecond))
}(time.Now())
if err := p.labelPairToFingerprints.IndexBatch(pairToFPs); err != nil {
glog.Error("Error indexing label pair to fingerprints batch: ", err)