@@ -117,16 +117,16 @@ public static void main(String[] args) throws RunnerException {
117117 }
118118
119119 @ Param ("1343120" )
120- private int numberOfDocuments ;
120+ private int nDocs ;
121121
122122 @ Param ({ "1340" , "121300" })
123123 private int batchSize ;
124124
125125 @ Param ("1000" )
126- private int timestampIncrementMillis ;
126+ private int deltaTime ;
127127
128128 @ Param ({ "0.01" , "0.2" , "0.8" })
129- private double timestampRangeFraction ;
129+ private double queryRange ;
130130
131131 @ Param ({ "7390" , "398470" })
132132 private int commitEvery ;
@@ -182,7 +182,7 @@ private IndexSearcher createIndex(final Directory directory, final boolean withD
182182 final Random random = new Random (seed );
183183 try (IndexWriter indexWriter = new IndexWriter (directory , config )) {
184184 int docCountSinceLastCommit = 0 ;
185- for (int i = 0 ; i < numberOfDocuments ; i ++) {
185+ for (int i = 0 ; i < nDocs ; i ++) {
186186 final Document doc = new Document ();
187187 addFieldsToDocument (doc , i , withDocValuesSkipper , random );
188188 indexWriter .addDocument (doc );
@@ -207,8 +207,8 @@ private IndexSearcher createIndex(final Directory directory, final boolean withD
207207 private void addFieldsToDocument (final Document doc , int docIndex , boolean withDocValuesSkipper , final Random random ) {
208208 final int batchIndex = docIndex / batchSize ;
209209 final String hostName = "host-" + batchIndex ;
210- final long timestampDelta = random .nextInt (0 , timestampIncrementMillis );
211- final long timestamp = BASE_TIMESTAMP + ((docIndex % batchSize ) * timestampIncrementMillis ) + timestampDelta ;
210+ final long timestampDelta = random .nextInt (0 , deltaTime );
211+ final long timestamp = BASE_TIMESTAMP + ((docIndex % batchSize ) * deltaTime ) + timestampDelta ;
212212
213213 if (withDocValuesSkipper ) {
214214 doc .add (SortedNumericDocValuesField .indexedField (TIMESTAMP_FIELD , timestamp )); // NOTE: doc values skipper on `@timestamp`
@@ -231,7 +231,7 @@ private void addFieldsToDocument(final Document doc, int docIndex, boolean withD
231231 * @return The computed upper bound for the timestamp range query.
232232 */
233233 private long rangeEndTimestamp () {
234- return BASE_TIMESTAMP + ((long ) (batchSize * timestampIncrementMillis * timestampRangeFraction ));
234+ return BASE_TIMESTAMP + ((long ) (batchSize * deltaTime * queryRange ));
235235 }
236236
237237 @ Benchmark
@@ -259,7 +259,7 @@ private long rangeQuery(final IndexSearcher searcher, long rangeStartTimestamp,
259259 rangeEndTimestamp ,
260260 rangeQuery
261261 );
262- return searcher .search (query , numberOfDocuments , QUERY_SORT ).totalHits .value ();
262+ return searcher .search (query , nDocs , QUERY_SORT ).totalHits .value ();
263263 }
264264
265265 @ TearDown (Level .Trial )
0 commit comments