@@ -127,6 +127,7 @@ class RollupShardIndexer {
127
127
}
128
128
129
129
public RollupIndexerAction .ShardRollupResponse execute () throws IOException {
130
+ long startTime = System .currentTimeMillis ();
130
131
BulkProcessor bulkProcessor = createBulkProcessor ();
131
132
try (searcher ; bulkProcessor ) {
132
133
// TODO: add cancellations
@@ -138,11 +139,12 @@ public RollupIndexerAction.ShardRollupResponse execute() throws IOException {
138
139
}
139
140
140
141
logger .info (
141
- "Shard {} successfully sent [{}], indexed [{}], failed [{}]" ,
142
+ "Shard [{}] successfully sent [{}], indexed [{}], failed [{}], took [{}]" ,
142
143
indexShard .shardId (),
143
144
numSent .get (),
144
145
numIndexed .get (),
145
- numFailed .get ()
146
+ numFailed .get (),
147
+ TimeValue .timeValueMillis (System .currentTimeMillis () - startTime )
146
148
);
147
149
148
150
if (numIndexed .get () != numSent .get ()) {
@@ -239,13 +241,15 @@ public void collect(int docId, long owningBucketOrd) throws IOException {
239
241
lastHistoTimestamp = rounding .round (timestamp );
240
242
}
241
243
242
- logger .trace (
243
- "Doc: [{}] - _tsid: [{}], @timestamp: [{}}] -> rollup bucket ts: [{}]" ,
244
- docId ,
245
- DocValueFormat .TIME_SERIES_ID .format (tsid ),
246
- timestampFormat .format (timestamp ),
247
- timestampFormat .format (lastHistoTimestamp )
248
- );
244
+ if (logger .isTraceEnabled ()) {
245
+ logger .trace (
246
+ "Doc: [{}] - _tsid: [{}], @timestamp: [{}}] -> rollup bucket ts: [{}]" ,
247
+ docId ,
248
+ DocValueFormat .TIME_SERIES_ID .format (tsid ),
249
+ timestampFormat .format (timestamp ),
250
+ timestampFormat .format (lastHistoTimestamp )
251
+ );
252
+ }
249
253
250
254
/*
251
255
* Sanity checks to ensure that we receive documents in the correct order
@@ -349,11 +353,14 @@ public RollupBucketBuilder init(BytesRef tsid, long timestamp) {
349
353
this .timestamp = timestamp ;
350
354
this .docCount = 0 ;
351
355
this .metricFieldProducers .values ().stream ().forEach (p -> p .reset ());
352
- logger .trace (
353
- "New bucket for _tsid: [{}], @timestamp: [{}]" ,
354
- DocValueFormat .TIME_SERIES_ID .format (tsid ),
355
- timestampFormat .format (timestamp )
356
- );
356
+ if (logger .isTraceEnabled ()) {
357
+ logger .trace (
358
+ "New bucket for _tsid: [{}], @timestamp: [{}]" ,
359
+ DocValueFormat .TIME_SERIES_ID .format (tsid ),
360
+ timestampFormat .format (timestamp )
361
+ );
362
+ }
363
+
357
364
return this ;
358
365
}
359
366
0 commit comments