mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
introduce filterScriptParams to remove params meant to control scenario script from the activity context
This commit is contained in:
parent
185206d83a
commit
a3b27f0225
@ -2,6 +2,24 @@
|
|||||||
function printa(arg) { java.lang.System.out.print(arg); }
|
function printa(arg) { java.lang.System.out.print(arg); }
|
||||||
//function println(arg) { java.lang.System.out.println(arg); }
|
//function println(arg) { java.lang.System.out.println(arg); }
|
||||||
|
|
||||||
|
const SCRIPT_PARAMS = ["sample_seconds", "latency_percentile", "latency_threshold", "minimum_ratio", "averageof"];
|
||||||
|
|
||||||
|
function filterScriptParams(activitydef) {
|
||||||
|
var def = {};
|
||||||
|
for (var p in activitydef) {
|
||||||
|
var isScriptParam = false;
|
||||||
|
for (i in SCRIPT_PARAMS) {
|
||||||
|
if (p == SCRIPT_PARAMS[i]) {
|
||||||
|
isScriptParam = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isScriptParam) {
|
||||||
|
def[p] = activitydef[p]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
||||||
if ("TEMPLATE(showhelp,false)" === "true") {
|
if ("TEMPLATE(showhelp,false)" === "true") {
|
||||||
var helpdata = files.read("docs/findmax.md");
|
var helpdata = files.read("docs/findmax.md");
|
||||||
@ -43,9 +61,9 @@ var baserate = scriptingmetrics.newGauge("findmax.base_rate", 0.0);
|
|||||||
|
|
||||||
// CREATE SCHEMA
|
// CREATE SCHEMA
|
||||||
|
|
||||||
schema_activitydef = params.withDefaults({
|
schema_activitydef = filterScriptParams(params.withDefaults({
|
||||||
type: "diag"
|
type: "diag"
|
||||||
});
|
}));
|
||||||
schema_activitydef.alias="findmax_schema";
|
schema_activitydef.alias="findmax_schema";
|
||||||
schema_activitydef.threads="1";
|
schema_activitydef.threads="1";
|
||||||
schema_activitydef.tags="TEMPLATE(schematags,block:\"schema.*\")";
|
schema_activitydef.tags="TEMPLATE(schematags,block:\"schema.*\")";
|
||||||
@ -56,10 +74,10 @@ scenario.run(schema_activitydef);
|
|||||||
// START ITERATING ACTIVITY
|
// START ITERATING ACTIVITY
|
||||||
|
|
||||||
|
|
||||||
activitydef = params.withDefaults({
|
activitydef = filterScriptParams(params.withDefaults({
|
||||||
type: "diag",
|
type: "diag",
|
||||||
threads: "50"
|
threads: "50"
|
||||||
});
|
}));
|
||||||
activitydef.alias="findmax";
|
activitydef.alias="findmax";
|
||||||
activitydef.cycles="1000000000";
|
activitydef.cycles="1000000000";
|
||||||
activitydef.recycles="1000000000";
|
activitydef.recycles="1000000000";
|
||||||
|
@ -26,6 +26,27 @@ function printf(args) {
|
|||||||
java.lang.System.out.printf(arguments[0],values);
|
java.lang.System.out.printf(arguments[0],values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SCRIPT_PARAMS = ["profile", "sample_time", "sample_incr", "sample_max", "averageof",
|
||||||
|
"min_stride", "rate_base", "rate_step", "rate_incr", "testrate_cutoff",
|
||||||
|
"bestrate_cutoff", "latency_cutoff", "latency_pctile"];
|
||||||
|
|
||||||
|
function filterScriptParams(activitydef) {
|
||||||
|
var def = {};
|
||||||
|
for (var p in activitydef) {
|
||||||
|
var isScriptParam = false;
|
||||||
|
for (i in SCRIPT_PARAMS) {
|
||||||
|
if (p == SCRIPT_PARAMS[i]) {
|
||||||
|
isScriptParam = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isScriptParam) {
|
||||||
|
def[p] = activitydef[p]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
||||||
if ("TEMPLATE(showhelp,false)" === "true") {
|
if ("TEMPLATE(showhelp,false)" === "true") {
|
||||||
var helpdata = files.read("docs/findmax.md");
|
var helpdata = files.read("docs/findmax.md");
|
||||||
printf(helpdata);
|
printf(helpdata);
|
||||||
@ -141,10 +162,10 @@ var driver = "TEMPLATE(driver,cql)";
|
|||||||
var yaml_file = "TEMPLATE(yaml_file,cql-iot)";
|
var yaml_file = "TEMPLATE(yaml_file,cql-iot)";
|
||||||
|
|
||||||
// // CREATE SCHEMA
|
// // CREATE SCHEMA
|
||||||
// schema_activitydef = params.withDefaults({
|
// schema_activitydef = filterScriptParams(params.withDefaults({
|
||||||
// driver: driver,
|
// driver: driver,
|
||||||
// yaml: yaml_file
|
// yaml: yaml_file
|
||||||
// });
|
// }));
|
||||||
//
|
//
|
||||||
// schema_activitydef.alias = "findmax_schema";
|
// schema_activitydef.alias = "findmax_schema";
|
||||||
// schema_activitydef.threads = "1";
|
// schema_activitydef.threads = "1";
|
||||||
@ -154,12 +175,12 @@ var yaml_file = "TEMPLATE(yaml_file,cql-iot)";
|
|||||||
// scenario.run(schema_activitydef);
|
// scenario.run(schema_activitydef);
|
||||||
|
|
||||||
// START ITERATING ACTIVITY
|
// START ITERATING ACTIVITY
|
||||||
activitydef = params.withDefaults({
|
activitydef = filterScriptParams(params.withDefaults({
|
||||||
driver: driver,
|
driver: driver,
|
||||||
yaml: yaml_file,
|
yaml: yaml_file,
|
||||||
threads: "auto",
|
threads: "auto",
|
||||||
cyclerate: "1.0:1.1"
|
cyclerate: "1.0:1.1"
|
||||||
});
|
}));
|
||||||
|
|
||||||
activitydef.alias = "findmax";
|
activitydef.alias = "findmax";
|
||||||
activitydef.cycles = "1000000000";
|
activitydef.cycles = "1000000000";
|
||||||
|
@ -16,6 +16,26 @@ function printf(args) {
|
|||||||
java.lang.System.out.printf(arguments[0], values);
|
java.lang.System.out.printf(arguments[0], values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SCRIPT_PARAMS = ["sample_time", "sample_incr", "sample_max", "min_stride", "averageof",
|
||||||
|
"latency_cutoff", "latency_pctile"];
|
||||||
|
|
||||||
|
function filterScriptParams(activitydef) {
|
||||||
|
var def = {};
|
||||||
|
for (var p in activitydef) {
|
||||||
|
var isScriptParam = false;
|
||||||
|
for (i in SCRIPT_PARAMS) {
|
||||||
|
if (p == SCRIPT_PARAMS[i]) {
|
||||||
|
isScriptParam = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isScriptParam) {
|
||||||
|
def[p] = activitydef[p]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
||||||
function as_js(ref) {
|
function as_js(ref) {
|
||||||
if (JSON.stringify(ref)) {
|
if (JSON.stringify(ref)) {
|
||||||
return ref;
|
return ref;
|
||||||
@ -106,10 +126,10 @@ let activity_type = "TEMPLATE(activity_type,cql)";
|
|||||||
let yaml_file = "TEMPLATE(yaml_file,cql-iot)";
|
let yaml_file = "TEMPLATE(yaml_file,cql-iot)";
|
||||||
|
|
||||||
// CREATE SCHEMA
|
// CREATE SCHEMA
|
||||||
schema_activitydef = params.withDefaults({
|
schema_activitydef = filterScriptParams(params.withDefaults({
|
||||||
type: activity_type,
|
type: activity_type,
|
||||||
yaml: yaml_file
|
yaml: yaml_file
|
||||||
});
|
}));
|
||||||
schema_activitydef.alias = "optimo_schema";
|
schema_activitydef.alias = "optimo_schema";
|
||||||
schema_activitydef.threads = "1";
|
schema_activitydef.threads = "1";
|
||||||
schema_activitydef.tags = "TEMPLATE(schematags,block:'schema.*')";
|
schema_activitydef.tags = "TEMPLATE(schematags,block:'schema.*')";
|
||||||
@ -119,13 +139,13 @@ print("Creating schema with schematags:" + schema_activitydef.tags);
|
|||||||
scenario.run(schema_activitydef);
|
scenario.run(schema_activitydef);
|
||||||
|
|
||||||
// START ITERATING ACTIVITY
|
// START ITERATING ACTIVITY
|
||||||
activitydef = params.withDefaults({
|
activitydef = filterScriptParams(params.withDefaults({
|
||||||
type: activity_type,
|
type: activity_type,
|
||||||
yaml: yaml_file,
|
yaml: yaml_file,
|
||||||
threads: "50",
|
threads: "50",
|
||||||
async: 10,
|
async: 10,
|
||||||
speculative: "none"
|
speculative: "none"
|
||||||
});
|
}));
|
||||||
activitydef.alias = "optimo";
|
activitydef.alias = "optimo";
|
||||||
activitydef.cycles = "1000000000";
|
activitydef.cycles = "1000000000";
|
||||||
activitydef.recycles = "1000000000";
|
activitydef.recycles = "1000000000";
|
||||||
|
@ -32,6 +32,25 @@ function printf(args) {
|
|||||||
java.lang.System.out.printf(arguments[0], values);
|
java.lang.System.out.printf(arguments[0], values);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const SCRIPT_PARAMS = ["sample_seconds", "max_rate", "rate_step"];
|
||||||
|
|
||||||
|
function filterScriptParams(activitydef) {
|
||||||
|
var def = {};
|
||||||
|
for (var p in activitydef) {
|
||||||
|
var isScriptParam = false;
|
||||||
|
for (i in SCRIPT_PARAMS) {
|
||||||
|
if (p == SCRIPT_PARAMS[i]) {
|
||||||
|
isScriptParam = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!isScriptParam) {
|
||||||
|
def[p] = activitydef[p]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return def;
|
||||||
|
}
|
||||||
|
|
||||||
var workload = "TEMPLATE(workload,UNSPECIFIED)";
|
var workload = "TEMPLATE(workload,UNSPECIFIED)";
|
||||||
if (workload=="UNSPECIFIED") {
|
if (workload=="UNSPECIFIED") {
|
||||||
print("workload was unspecified. Please set workload and try again.");
|
print("workload was unspecified. Please set workload and try again.");
|
||||||
@ -50,14 +69,14 @@ printf("max_rate=%d\n", max_rate);
|
|||||||
|
|
||||||
var rate_step = 10000;
|
var rate_step = 10000;
|
||||||
rate_step = 0 + TEMPLATE(rate_step,rate_step);
|
rate_step = 0 + TEMPLATE(rate_step,rate_step);
|
||||||
printf("rate_increment=%d\n", rate_step);
|
printf("rate_step=%d\n", rate_step);
|
||||||
|
|
||||||
var driver = "TEMPLATE(driver,diag)"
|
var driver = "TEMPLATE(driver,diag)"
|
||||||
printf("driver=%s\n",driver);
|
printf("driver=%s\n",driver);
|
||||||
|
|
||||||
|
|
||||||
print("starting activity for stepup analysis");
|
print("starting activity for stepup analysis");
|
||||||
var activitydef = params.withDefaults({
|
var activitydef = filterScriptParams(params.withDefaults({
|
||||||
'alias': 'stepup',
|
'alias': 'stepup',
|
||||||
'driver': driver,
|
'driver': driver,
|
||||||
'tags':'any(block:main.*,block:main)',
|
'tags':'any(block:main.*,block:main)',
|
||||||
@ -65,7 +84,7 @@ var activitydef = params.withDefaults({
|
|||||||
'cycles': '1t',
|
'cycles': '1t',
|
||||||
'stride': '1000',
|
'stride': '1000',
|
||||||
'striderate': '1:1.05:restart'
|
'striderate': '1:1.05:restart'
|
||||||
});
|
}));
|
||||||
|
|
||||||
var csvlogger = csvoutput.open('stepup_metrics/stepup_rates.csv', 'time', 'workload', 'rate', 'ops')
|
var csvlogger = csvoutput.open('stepup_metrics/stepup_rates.csv', 'time', 'workload', 'rate', 'ops')
|
||||||
var csvhistologger=csvmetrics.log("stepup_metrics");
|
var csvhistologger=csvmetrics.log("stepup_metrics");
|
||||||
|
Loading…
Reference in New Issue
Block a user