This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr-orbit-workloads.git
The following commit(s) were added to refs/heads/main by this push:
new 8ba3705 nyc_taxis: draw randomized dates from each operation's facet
window (#23)
8ba3705 is described below
commit 8ba37056ab5f3f4889070937bd114cb9cb073cc9
Author: Syed Ahnaf Raza <[email protected]>
AuthorDate: Sun Nov 8 00:10:01 2026 +0500
nyc_taxis: draw randomized dates from each operation's facet window (#23)
The date value sources only drew from 2015-01-01 to 2015-01-15, so
randomized histogram queries never left the first two weeks of a
corpus that spans all of 2015.
Draw the calendar and fixed-interval histogram ranges from all of 2015,
the window both facet over, and the daily histogram ranges from the
21 days its facet covers.
Fixes #12
---
nyc_taxis/workload.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/nyc_taxis/workload.py b/nyc_taxis/workload.py
index c0d793e..50c8960 100644
--- a/nyc_taxis/workload.py
+++ b/nyc_taxis/workload.py
@@ -57,17 +57,22 @@ def random_dates(min_value, max_value, format_string,
whole_days=False):
}
# Standard value sources for our operations
+# Each date source draws from the window its operation facets over, so
randomized
+# queries stay inside the facet range set in operations/default.json.
start_date = datetime.datetime(2015, 1, 1)
-end_date = datetime.datetime(2015, 1, 15)
+# date_histogram_calendar_interval and date_histogram_fixed_interval facet
over all of 2015.
+corpus_end_date = datetime.datetime(2016, 1, 1)
+# date_histogram_facet facets over 2015-01-01 to 2015-01-22 (exclusive), i.e.
the days 1 to 21.
+daily_histogram_end_date = datetime.datetime(2015, 1, 22)
def total_amount_source():
return random_money_values(111.98)
def date_source_with_hours():
- return random_dates(start_date, end_date,
format_string="%Y-%m-%dT%H:%M:%SZ")
+ return random_dates(start_date, corpus_end_date,
format_string="%Y-%m-%dT%H:%M:%SZ")
def date_source_without_hours():
- return random_dates(start_date, end_date,
format_string="%Y-%m-%dT%H:%M:%SZ", whole_days=True)
+ return random_dates(start_date, daily_histogram_end_date,
format_string="%Y-%m-%dT%H:%M:%SZ", whole_days=True)
def trip_distance_source():
gte = random.randint(0, 10)