mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
functional run named scenario ui (except for the run button)
This commit is contained in:
parent
d8b3e6214c
commit
71ee22039e
docsys/src/main
node/docsys
resources/docsys-guidebook
200.html
_nuxt
03056607be941ec702c3.js06592ce2abe0b5804b1d.js0feadcc9602758adfc03.js17caa30bc5148c3b1167.js20e204977e331e222f04.js2db30ff69d2689005afd.js3075e9c63b07a6d88331.js3179369742c1dbefdc94.js35ded9159e5aa5616960.js3a496b8c293c39cf6081.js48e7b324ad6ae108b9e2.js4948cee06bd058a8b88a.js4be23a108097ec7c320d.js7950fa788c28a8d2d4a2.js7eb7a3a73dc5915a986c.js8d3cf518e1e9d8352839.js900dca5501bd22b95704.js9274df7b92b9c313bf36.js9830e47321545405404a.js9962ca910f9a62ec84b8.jsa1cbfece39b8e1ea981a.jsa32e39032f73a0c63675.jsb8e81b2b492f6dd24df6.jsba36f1d15067f3126abb.jsbdfd456d9b7407d77bf5.jsf28ec2c5c77be90ea577.js
index.htmlengine-api/src/main/java/io/nosqlbench/engine/api/scenarios
engine-cli/src/main/java/io/nosqlbench/engine/cli
engine-core/src/main/java/io/nosqlbench/engine/core/services
@ -46,6 +46,7 @@ export default {
|
||||
'@nuxtjs/axios'
|
||||
],
|
||||
axios: {
|
||||
port: 12345
|
||||
|
||||
},
|
||||
/*
|
||||
|
@ -9,23 +9,66 @@
|
||||
</v-toolbar-items>
|
||||
</v-app-bar>
|
||||
|
||||
<v-layout
|
||||
justify-center
|
||||
align-center>
|
||||
|
||||
<v-content>
|
||||
<v-container v-if="enabled">
|
||||
<v-row align="stretch">
|
||||
<v-container fluid v-if="enabled">
|
||||
|
||||
|
||||
<v-col class="d-flex" cols="12" sm="6">
|
||||
<v-select
|
||||
:items="workloads"
|
||||
:items="workloadNames"
|
||||
v-model="workloadName"
|
||||
chips
|
||||
v-on:change="getTemplates();"
|
||||
label="Workload"
|
||||
></v-select>
|
||||
</v-col>
|
||||
|
||||
</v-container>
|
||||
|
||||
<v-container fluid>
|
||||
<v-row
|
||||
v-if="templates"
|
||||
>
|
||||
<v-col
|
||||
cols="12"
|
||||
sm="6"
|
||||
md="10"
|
||||
lg="10"
|
||||
>
|
||||
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
{{ workloadName }}
|
||||
</v-card-title>
|
||||
<v-col
|
||||
v-for="(item, j) in Object.keys(templates)"
|
||||
:key="item.command"
|
||||
cols="12"
|
||||
sm="6"
|
||||
md="10"
|
||||
lg="10"
|
||||
>
|
||||
<v-text-field
|
||||
v-model="templates[item]"
|
||||
:label="item"
|
||||
>{{ item.name }}</v-text-field>
|
||||
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<v-btn v-if="workloadName" v-on:click="runWorkload()">Run Workload</v-btn>
|
||||
</v-col>
|
||||
</v-card>
|
||||
</v-col>
|
||||
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
|
||||
</v-container>
|
||||
|
||||
</v-content>
|
||||
</v-layout>
|
||||
|
||||
<v-footer app dark color="secondary">
|
||||
<span>© 2020</span>
|
||||
@ -43,11 +86,19 @@
|
||||
computed: {
|
||||
},
|
||||
methods: {
|
||||
async getTemplates() {
|
||||
const data = await this.$axios.$get('/services/nb/parameters?workloadName=' + this.workloadName)
|
||||
if (!data.err) {
|
||||
this.$data.templates = data;
|
||||
}
|
||||
},
|
||||
},
|
||||
data(context) {
|
||||
let data = {
|
||||
workloads: [1, 2, 3],
|
||||
enabled: false
|
||||
workloadNames: [],
|
||||
enabled: false,
|
||||
workloadName: null,
|
||||
templates: null,
|
||||
};
|
||||
return data;
|
||||
},
|
||||
@ -59,7 +110,7 @@
|
||||
.catch((e) => {
|
||||
console.log("back-end not found");
|
||||
})
|
||||
let workloads = await $axios.$get("/services/nb/workloads")
|
||||
let workloadNames = await $axios.$get("/services/nb/workloads")
|
||||
.then(res => {
|
||||
return res
|
||||
})
|
||||
@ -70,7 +121,7 @@
|
||||
|
||||
return {
|
||||
enabled: enabled,
|
||||
workloads: workloads,
|
||||
workloadNames: workloadNames,
|
||||
}
|
||||
},
|
||||
}
|
||||
@ -78,7 +129,6 @@
|
||||
<style>
|
||||
.container {
|
||||
margin: 0 auto;
|
||||
min-height: 60vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
@ -1,9 +1,9 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>NoSQLBench</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/82626aa0367d3e78a341.js" as="script"><link rel="preload" href="/_nuxt/2db30ff69d2689005afd.js" as="script"><link rel="preload" href="/_nuxt/900dca5501bd22b95704.js" as="script"><link rel="preload" href="/_nuxt/35ded9159e5aa5616960.js" as="script">
|
||||
<title>NoSQLBench</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/0feadcc9602758adfc03.js" as="script"><link rel="preload" href="/_nuxt/4be23a108097ec7c320d.js" as="script"><link rel="preload" href="/_nuxt/f28ec2c5c77be90ea577.js" as="script"><link rel="preload" href="/_nuxt/3179369742c1dbefdc94.js" as="script">
|
||||
</head>
|
||||
<body>
|
||||
<div id="__nuxt"><style>#nuxt-loading{visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #fff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div>
|
||||
<script type="text/javascript" src="/_nuxt/82626aa0367d3e78a341.js"></script><script type="text/javascript" src="/_nuxt/2db30ff69d2689005afd.js"></script><script type="text/javascript" src="/_nuxt/900dca5501bd22b95704.js"></script><script type="text/javascript" src="/_nuxt/35ded9159e5aa5616960.js"></script></body>
|
||||
<script type="text/javascript" src="/_nuxt/0feadcc9602758adfc03.js"></script><script type="text/javascript" src="/_nuxt/4be23a108097ec7c320d.js"></script><script type="text/javascript" src="/_nuxt/f28ec2c5c77be90ea577.js"></script><script type="text/javascript" src="/_nuxt/3179369742c1dbefdc94.js"></script></body>
|
||||
</html>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
!function(e){function r(data){for(var r,n,f=data[0],l=data[1],d=data[2],i=0,h=[];i<f.length;i++)n=f[i],Object.prototype.hasOwnProperty.call(o,n)&&o[n]&&h.push(o[n][0]),o[n]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(v&&v(data);h.length;)h.shift()();return c.push.apply(c,d||[]),t()}function t(){for(var e,i=0;i<c.length;i++){for(var r=c[i],t=!0,n=1;n<r.length;n++){var l=r[n];0!==o[l]&&(t=!1)}t&&(c.splice(i--,1),e=f(f.s=r[0]))}return e}var n={},o={11:0},c=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var c,script=document.createElement("script");script.charset="utf-8",script.timeout=120,f.nc&&script.setAttribute("nonce",f.nc),script.src=function(e){return f.p+""+{0:"03056607be941ec702c3",1:"a1cbfece39b8e1ea981a",2:"48e7b324ad6ae108b9e2",3:"287ef5fb37a341b3c9cd",6:"4948cee06bd058a8b88a",7:"a32e39032f73a0c63675",8:"9274df7b92b9c313bf36",9:"7950fa788c28a8d2d4a2",10:"3a496b8c293c39cf6081",13:"9962ca910f9a62ec84b8"}[e]+".js"}(e);var l=new Error;c=function(r){script.onerror=script.onload=null,clearTimeout(d);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;l.message="Loading chunk "+e+" failed.\n("+n+": "+c+")",l.name="ChunkLoadError",l.type=n,l.request=c,t[1](l)}o[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:script})}),12e4);script.onerror=script.onload=c,document.head.appendChild(script)}return Promise.all(r)},f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(object,e){return Object.prototype.hasOwnProperty.call(object,e)},f.p="/_nuxt/",f.oe=function(e){throw console.error(e),e};var l=window.webpackJsonp=window.webpackJsonp||[],d=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var v=d;t()}([]);
|
||||
!function(e){function r(data){for(var r,n,f=data[0],l=data[1],d=data[2],i=0,h=[];i<f.length;i++)n=f[i],Object.prototype.hasOwnProperty.call(o,n)&&o[n]&&h.push(o[n][0]),o[n]=0;for(r in l)Object.prototype.hasOwnProperty.call(l,r)&&(e[r]=l[r]);for(v&&v(data);h.length;)h.shift()();return c.push.apply(c,d||[]),t()}function t(){for(var e,i=0;i<c.length;i++){for(var r=c[i],t=!0,n=1;n<r.length;n++){var l=r[n];0!==o[l]&&(t=!1)}t&&(c.splice(i--,1),e=f(f.s=r[0]))}return e}var n={},o={11:0},c=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var c,script=document.createElement("script");script.charset="utf-8",script.timeout=120,f.nc&&script.setAttribute("nonce",f.nc),script.src=function(e){return f.p+""+{0:"9830e47321545405404a",1:"7eb7a3a73dc5915a986c",2:"b8e81b2b492f6dd24df6",3:"17caa30bc5148c3b1167",6:"20e204977e331e222f04",7:"3075e9c63b07a6d88331",8:"8d3cf518e1e9d8352839",9:"ba36f1d15067f3126abb",10:"06592ce2abe0b5804b1d",13:"bdfd456d9b7407d77bf5"}[e]+".js"}(e);var l=new Error;c=function(r){script.onerror=script.onload=null,clearTimeout(d);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),c=r&&r.target&&r.target.src;l.message="Loading chunk "+e+" failed.\n("+n+": "+c+")",l.name="ChunkLoadError",l.type=n,l.request=c,t[1](l)}o[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:script})}),12e4);script.onerror=script.onload=c,document.head.appendChild(script)}return Promise.all(r)},f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(object,e){return Object.prototype.hasOwnProperty.call(object,e)},f.p="/_nuxt/",f.oe=function(e){throw console.error(e),e};var l=window.webpackJsonp=window.webpackJsonp||[],d=l.push.bind(l);l.push=r,l=l.slice();for(var i=0;i<l.length;i++)r(l[i]);var v=d;t()}([]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,9 +1,9 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>NoSQLBench</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/82626aa0367d3e78a341.js" as="script"><link rel="preload" href="/_nuxt/2db30ff69d2689005afd.js" as="script"><link rel="preload" href="/_nuxt/900dca5501bd22b95704.js" as="script"><link rel="preload" href="/_nuxt/35ded9159e5aa5616960.js" as="script">
|
||||
<title>NoSQLBench</title><meta data-n-head="1" charset="utf-8"><meta data-n-head="1" name="viewport" content="width=device-width,initial-scale=1"><meta data-n-head="1" data-hid="description" name="description" content="Docs App for NoSQLBench"><link data-n-head="1" rel="icon" type="image/x-icon" href="/favicon.ico"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"><link data-n-head="1" rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link rel="preload" href="/_nuxt/0feadcc9602758adfc03.js" as="script"><link rel="preload" href="/_nuxt/4be23a108097ec7c320d.js" as="script"><link rel="preload" href="/_nuxt/f28ec2c5c77be90ea577.js" as="script"><link rel="preload" href="/_nuxt/3179369742c1dbefdc94.js" as="script">
|
||||
</head>
|
||||
<body>
|
||||
<div id="__nuxt"><style>#nuxt-loading{visibility:hidden;opacity:0;position:absolute;left:0;right:0;top:0;bottom:0;display:flex;justify-content:center;align-items:center;flex-direction:column;animation:nuxtLoadingIn 10s ease;-webkit-animation:nuxtLoadingIn 10s ease;animation-fill-mode:forwards;overflow:hidden}@keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}@-webkit-keyframes nuxtLoadingIn{0%{visibility:hidden;opacity:0}20%{visibility:visible;opacity:0}100%{visibility:visible;opacity:1}}#nuxt-loading>div,#nuxt-loading>div:after{border-radius:50%;width:5rem;height:5rem}#nuxt-loading>div{font-size:10px;position:relative;text-indent:-9999em;border:.5rem solid #f5f5f5;border-left:.5rem solid #fff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:nuxtLoading 1.1s infinite linear;animation:nuxtLoading 1.1s infinite linear}#nuxt-loading.error>div{border-left:.5rem solid #ff4500;animation-duration:5s}@-webkit-keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes nuxtLoading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}</style><script>window.addEventListener("error",function(){var e=document.getElementById("nuxt-loading");e&&(e.className+=" error")})</script><div id="nuxt-loading" aria-live="polite" role="status"><div>Loading...</div></div></div>
|
||||
<script type="text/javascript" src="/_nuxt/82626aa0367d3e78a341.js"></script><script type="text/javascript" src="/_nuxt/2db30ff69d2689005afd.js"></script><script type="text/javascript" src="/_nuxt/900dca5501bd22b95704.js"></script><script type="text/javascript" src="/_nuxt/35ded9159e5aa5616960.js"></script></body>
|
||||
<script type="text/javascript" src="/_nuxt/0feadcc9602758adfc03.js"></script><script type="text/javascript" src="/_nuxt/4be23a108097ec7c320d.js"></script><script type="text/javascript" src="/_nuxt/f28ec2c5c77be90ea577.js"></script><script type="text/javascript" src="/_nuxt/3179369742c1dbefdc94.js"></script></body>
|
||||
</html>
|
||||
|
@ -265,6 +265,7 @@ public class NBCLIScenarioParser {
|
||||
// }
|
||||
|
||||
private static Pattern templatePattern = Pattern.compile("TEMPLATE\\((.+?)\\)");
|
||||
private static Pattern innerTemplatePattern = Pattern.compile("TEMPLATE\\((.+?)$");
|
||||
private static Pattern templatePattern2 = Pattern.compile("<<(.+?)>>");
|
||||
|
||||
|
||||
@ -289,21 +290,11 @@ public class NBCLIScenarioParser {
|
||||
Content<?> content = referencedWorkload.orElseThrow();
|
||||
StmtsDocList stmts = StatementsLoader.load(logger,content);
|
||||
|
||||
Set<String> templates = new HashSet<>();
|
||||
Map<String, String> templates = new HashMap<>();
|
||||
try {
|
||||
List<String> lines = Files.readAllLines(yamlPath);
|
||||
for (String line : lines) {
|
||||
Matcher matcher = templatePattern.matcher(line);
|
||||
|
||||
while (matcher.find()) {
|
||||
templates.add(matcher.group(1));
|
||||
}
|
||||
matcher = templatePattern2.matcher(line);
|
||||
|
||||
while (matcher.find()) {
|
||||
templates.add(matcher.group(1));
|
||||
}
|
||||
|
||||
templates = matchTemplates(line, templates);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
@ -322,4 +313,34 @@ public class NBCLIScenarioParser {
|
||||
return workloadDescriptions;
|
||||
}
|
||||
|
||||
public static Map<String, String> matchTemplates(String line, Map<String, String> templates) {
|
||||
Matcher matcher = templatePattern.matcher(line);
|
||||
|
||||
while (matcher.find()) {
|
||||
String match = matcher.group(1);
|
||||
|
||||
Matcher innerMatcher = innerTemplatePattern.matcher(match);
|
||||
String[] matchArray = match.split(",");
|
||||
//TODO: support recursive matches
|
||||
if (innerMatcher.find()) {
|
||||
String[] innerMatch = innerMatcher.group(1).split(",");
|
||||
|
||||
//We want the outer name with the inner default value
|
||||
templates.put(matchArray[0], innerMatch[1]);
|
||||
|
||||
}else{
|
||||
templates.put(matchArray[0], matchArray[1]);
|
||||
}
|
||||
}
|
||||
matcher = templatePattern2.matcher(line);
|
||||
|
||||
while (matcher.find()) {
|
||||
String match = matcher.group(1);
|
||||
String[] matchArray = match.split(":");
|
||||
templates.put(matchArray[0],matchArray[1]);
|
||||
}
|
||||
return templates;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
package io.nosqlbench.engine.api.scenarios;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
public class WorkloadDesc {
|
||||
private final String yamlPath;
|
||||
private final List<String> scenarioNames;
|
||||
private final Set<String> templates;
|
||||
private final Map<String, String> templates;
|
||||
|
||||
public WorkloadDesc(String yamlPath, List<String> scenarioNames, Set<String> templates) {
|
||||
public WorkloadDesc(String yamlPath, List<String> scenarioNames, Map<String, String> templates) {
|
||||
this.yamlPath = yamlPath;
|
||||
this.scenarioNames = scenarioNames;
|
||||
this.templates = templates;
|
||||
@ -27,7 +27,7 @@ public class WorkloadDesc {
|
||||
return scenarioNames;
|
||||
}
|
||||
|
||||
public Set<String> getTemplates() {
|
||||
public Map<String, String> getTemplates() {
|
||||
return templates;
|
||||
}
|
||||
}
|
||||
|
@ -280,14 +280,12 @@ public class NBCLI {
|
||||
System.out.println(" nb " + workloadName + " " + scenario);
|
||||
}
|
||||
|
||||
Set<String> templates = workload.getTemplates();
|
||||
Map<String, String> templates = workload.getTemplates();
|
||||
if (templates.size() > 0) {
|
||||
System.out.println(" # defaults");
|
||||
templates.stream()
|
||||
.map(x -> x.replaceAll(",", "="))
|
||||
.map(x -> x.replaceAll(":", "="))
|
||||
.map(x -> " " + x)
|
||||
.forEach(System.out::println);
|
||||
for (Map.Entry<String, String> templateEntry: templates.entrySet()) {
|
||||
System.out.println(" " + templateEntry.getKey() + " = " + templateEntry.getValue());
|
||||
}
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
@ -15,8 +15,7 @@ import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.BinaryOperator;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service(WebServiceObject.class)
|
||||
@ -43,12 +42,12 @@ public class WorkloadFinderEndpoint implements WebServiceObject {
|
||||
@GET
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@Path("parameters")
|
||||
public Set<String> getParametersByWorkload(@QueryParam("workloadName") String workloadName) {
|
||||
public Map<String, String> getParametersByWorkload(@QueryParam("workloadName") String workloadName) {
|
||||
List<WorkloadDesc> workloads = NBCLIScenarioParser.getWorkloadsWithScenarioScripts();
|
||||
|
||||
Set<String> templates = null;
|
||||
Map<String, String> templates = null;
|
||||
|
||||
Set<String> temlpates = workloads.stream()
|
||||
templates = workloads.stream()
|
||||
.filter(workload -> workload.getWorkloadName().equals(workloadName))
|
||||
.map(workload -> workload.getTemplates())
|
||||
.collect(Collectors.toSet()).iterator().next();
|
||||
|
Loading…
Reference in New Issue
Block a user