Skip to content

Commit

Permalink
throwaway code for checking on updated parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Rick Boyd committed Oct 26, 2020
1 parent 6bb91d4 commit d7b1ac4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 100 deletions.
99 changes: 1 addition & 98 deletions geonames/challenges/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,111 +55,14 @@
"include-in-reporting": false
}
},
{
"operation": "index-stats",
"warmup-iterations": 500,
"iterations": 1000,
"target-throughput": 90
},
{
"operation": "node-stats",
"warmup-iterations": 100,
"iterations": 1000,
"target-throughput": 90
},
{
"operation": "default",
"warmup-iterations": 500,
"iterations": 1000,
"target-throughput": 50
},
{
"operation": "term",
"warmup-iterations": 500,
"iterations": 1000,
"target-throughput": 150
},
{
"operation": "phrase",
"warmup-iterations": 500,
"iterations": 1000,
"target-throughput": 150
},
{
"operation": "country_agg_uncached",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 3.6
},
{
"operation": "country_agg_cached",
"warmup-iterations": 1000,
"iterations": 1000,
"target-throughput": 100
},
{
"operation": "scroll",
"warmup-iterations": 200,
"iterations": 100,
"#COMMENT": "Throughput is considered per request. So we issue one scroll request per second which will retrieve 25 pages",
"target-throughput": 0.8
},
{
"operation": "expression",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 2
},
{
"operation": "painless_static",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1.5
},
{
"operation": "painless_dynamic",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1.5
},
{
"operation": "decay_geo_gauss_function_score",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1
},
{
"operation": "decay_geo_gauss_script_score",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1
},
{
"operation": "field_value_function_score",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1.5
},
{
"operation": "field_value_script_score",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1.5
},
{
"operation": "random_function_score",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1.5
},
{
"operation": "random_script_score",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1.5
},
{
"operation": "large_terms",
"operation": "large_terms_trace_enabled",
"warmup-iterations": 200,
"iterations": 100,
"target-throughput": 1.1
Expand Down
11 changes: 10 additions & 1 deletion geonames/operations/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{
"name": "index-update",
"operation-type": "bulk",
"request-timeout": 0.1,
"bulk-size": {{bulk_size | default(5000)}},
"ingest-percentage": {{ingest_percentage | default(100)}},
"conflicts": "{{conflicts | default('random')}}",
Expand All @@ -26,6 +27,9 @@
{
"name": "term",
"operation-type": "search",
"headers": {
"Authorization2": "Basic {{ b64_user_password | default('YWRtaW46cGFzc3cwcmQ=') }}"
},
"body": {
"query": {
"term": {
Expand Down Expand Up @@ -277,7 +281,12 @@
}
}
}
},
},
{
"name": "large_terms_trace_enabled",
"operation-type": "search",
"param-source": "pure-terms-query-source-traced"
},
{
"name": "large_terms",
"operation-type": "search",
Expand Down
18 changes: 17 additions & 1 deletion geonames/track.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import random
import os

import base64

class QueryParamSource:
# We need to stick to the param source API
Expand Down Expand Up @@ -39,6 +39,20 @@ def params(self):

return result

class PureTermsQueryParamSourceTraced(PureTermsQueryParamSource):
# indeed a very dumb idea for a param-source but shows how traffic would look if rally had a switch for enabling
# opentracing tooling for Elastic APM or Jaeger, if we wanted to debug a thing
def params(self):
result = super().params()
trace_id = "%032x" % random.randrange(16**30)
parent_id = "%016x" % random.randrange(16**30)
trace_header = f"00-{trace_id}-{parent_id}-01"
result["headers"] = {
"traceparent": trace_header,
"tracestate": f"myfakeapm-{base64.b64encode(parent_id.encode('ascii'))}"
}
result["opaque-id"] = trace_id
return result

class FilteredTermsQueryParamSource(QueryParamSource):
def params(self):
Expand Down Expand Up @@ -106,11 +120,13 @@ def params(self):
return result



def refresh(es, params):
es.indices.refresh(index=params.get("index", "_all"))


def register(registry):
registry.register_param_source("pure-terms-query-source", PureTermsQueryParamSource)
registry.register_param_source("pure-terms-query-source-traced", PureTermsQueryParamSourceTraced)
registry.register_param_source("filtered-terms-query-source", FilteredTermsQueryParamSource)
registry.register_param_source("prohibited-terms-query-source", ProhibitedTermsQueryParamSource)

0 comments on commit d7b1ac4

Please sign in to comment.