Skip to content

Commit

Permalink
small adjust
Browse files Browse the repository at this point in the history
Signed-off-by: SamYuan1990 <yy19902439@126.com>
  • Loading branch information
SamYuan1990 committed Nov 9, 2020
1 parent 9d7ca52 commit 83c3dd5
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 99 deletions.
16 changes: 8 additions & 8 deletions e2e/app.test.js
Expand Up @@ -24,27 +24,27 @@ describe('# test app.js', function () {
});
it('GET /api/getBatchTimeout', function (done) {
request
.get('/api/getBatchTimeout')
.get('/api/get?data=BatchTimeout')
.expect(200, done);
});
it('GET /api/getMaxMessageCount', function (done) {
request
.get('/api/getMaxMessageCount')
.get('/api/get?data=MaxMessageCount')
.expect(200, done);
});
it('GET /api/getAbsoluteMaxBytes', function (done) {
it('GET /api/get?data=AbsoluteMaxBytes', function (done) {
request
.get('/api/getAbsoluteMaxBytes')
.get('/api/get?data=AbsoluteMaxBytes')
.expect(200, done);
});
it('GET /api/getPreferredMaxBytes', function (done) {
it('GET /api/get?data=PreferredMaxBytes', function (done) {
request
.get('/api/getPreferredMaxBytes')
.get('/api/get?data=PreferredMaxBytes')
.expect(200, done);
});
it('GET /api/getTPS', function (done) {
it('GET /api/get?data=TPS', function (done) {
request
.get('/api/getTPS')
.get('/api/get?data=TPS')
.expect(200, done);
});
it('GET / 200 result', function (done) {
Expand Down
134 changes: 66 additions & 68 deletions public/javascripts/index.js
@@ -1,85 +1,85 @@
var xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET","./api/getBatchTimeout",false);
const xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', './api/get?data=BatchTimeout', false);
xmlhttp.send();
var BatchTimeout = xmlhttp.responseText.split(',');
const BatchTimeout = xmlhttp.responseText.split(',');

xmlhttp.open("GET","./api/getTPS",false);
xmlhttp.open('GET', './api/get?data=TPS', false);
xmlhttp.send();
var TPS = xmlhttp.responseText.split(',');
const TPS = xmlhttp.responseText.split(',');

xmlhttp.open("GET","./api/getMaxMessageCount",false);
xmlhttp.open('GET', './api/get?data=MaxMessageCount', false);
xmlhttp.send();
var MaxMessageCount = xmlhttp.responseText.split(',');
const MaxMessageCount = xmlhttp.responseText.split(',');

xmlhttp.open("GET","./api/getAbsoluteMaxBytes",false);
xmlhttp.open('GET', './api/get?data=AbsoluteMaxBytes', false);
xmlhttp.send();
var AbsoluteMaxBytes = xmlhttp.responseText.split(',');
const AbsoluteMaxBytes = xmlhttp.responseText.split(',');

xmlhttp.open("GET","./api/getPreferredMaxBytes",false);
xmlhttp.open('GET', './api/get?data=PreferredMaxBytes', false);
xmlhttp.send();
var PreferredMaxBytes = xmlhttp.responseText.split(',');
const PreferredMaxBytes = xmlhttp.responseText.split(',');

var Turn1 = {
opacity: 0.5,
color: 'rgba(255,127,80,0.7)',
type: 'scatter3d',
x: BatchTimeout,
y: MaxMessageCount,
z: TPS,
scene: "scene1"
};
const Turn1 = {
opacity: 0.5,
color: 'rgba(255,127,80,0.7)',
type: 'scatter3d',
x: BatchTimeout,
y: MaxMessageCount,
z: TPS,
scene: 'scene1'
};

var Turn2 = {
opacity: 0.5,
color: 'pink',
type: 'scatter3d',//'mesh3d',
x: BatchTimeout,
y: AbsoluteMaxBytes,
z: TPS,
scene: "scene2"
};
const Turn2 = {
opacity: 0.5,
color: 'pink',
type: 'scatter3d', // 'mesh3d',
x: BatchTimeout,
y: AbsoluteMaxBytes,
z: TPS,
scene: 'scene2'
};

var Turn3 = {
opacity:0.4,
color:'rgb(033,255,100)',
type: 'scatter3d',
x: BatchTimeout,
y: PreferredMaxBytes,
z: TPS,
scene: "scene3",
};
const Turn3 = {
opacity:0.4,
color:'rgb(033,255,100)',
type: 'scatter3d',
x: BatchTimeout,
y: PreferredMaxBytes,
z: TPS,
scene: 'scene3',
};

const Turn4 = {
opacity: 0.5,
color:'rgb(200,100,200)',
type: 'scatter3d',
x: MaxMessageCount,
y: AbsoluteMaxBytes,
z: TPS,
scene: 'scene4'
};

var Turn4 = {
opacity: 0.5,
color:'rgb(200,100,200)',
type: 'scatter3d',
x: MaxMessageCount,
y: AbsoluteMaxBytes,
z: TPS,
scene: "scene4"
};

var Turn5 = {
const Turn5 = {
opacity: 0.5,
color:'rgb(00,150,200)',
type: 'scatter3d',
x: MaxMessageCount,
y: PreferredMaxBytes,
z: TPS,
scene: "scene5",
}
scene: 'scene5',
};

var Turn6 = {
const Turn6 = {
opacity: 0.5,
color:'rgb(033,150,200)',
type: 'scatter3d',
x: AbsoluteMaxBytes,
y: PreferredMaxBytes,
z: TPS,
scene: "scene6",
}
scene: 'scene6',
};

var layout = {
const layout = {
scene1: {
domain: {
x: [0.0, 0.33],
Expand All @@ -95,7 +95,7 @@ var layout = {
x: [0.66, 0.99],
y: [0.5, 1.0]
}},
scene4: {
scene4: {
domain: {
x: [0.0, 0.33],
y: [0, 0.5]
Expand All @@ -110,16 +110,14 @@ var layout = {
x: [0.66, 0.99],
y: [0, 0.5]
},},
height: 600,
margin: {
l: 0,
r: 0,
b: 0,
t: 0,
pad: 0
},
}
console.log(BatchTimeout);
console.log(Turn1);
height: 600,
margin: {
l: 0,
r: 0,
b: 0,
t: 0,
pad: 0
},
};

Plotly.newPlot('myDiv', [Turn1,Turn2,Turn3,Turn4,Turn5,Turn6], layout);
Plotly.newPlot('myDiv', [Turn1, Turn2, Turn3, Turn4, Turn5, Turn6], layout);
21 changes: 3 additions & 18 deletions routes/api.js
Expand Up @@ -13,24 +13,9 @@ router.get('/', function(req, res, next) {
res.send('respond with a resource');
});

router.get('/getBatchTimeout', function(req, res, next) {
res.send(fileIO.loadRs(fileIO.BatchTimeout));
});

router.get('/getMaxMessageCount', function(req, res, next) {
res.send(fileIO.loadRs(fileIO.MaxMessageCount));
});

router.get('/getAbsoluteMaxBytes', function(req, res, next) {
res.send(fileIO.loadRs(fileIO.AbsoluteMaxBytes));
});

router.get('/getPreferredMaxBytes', function(req, res, next) {
res.send(fileIO.loadRs(fileIO.PreferredMaxBytes));
});

router.get('/getTPS', function(req, res, next) {
res.send(fileIO.loadRs(fileIO.TPS));
// get?data=?&orderby=?
router.get('/get', function(req, res, next) {
res.send(fileIO.loadRs(req.query.data));
});

function prepareArray(input) {
Expand Down
10 changes: 5 additions & 5 deletions test/app.test.js
Expand Up @@ -33,27 +33,27 @@ describe('# test app.js', function () {

it('GET /api/getBatchTimeout', function (done) {
request
.get('/api/getBatchTimeout')
.get('/api/get?data=BatchTimeout')
.expect(200, done);
});
it('GET /api/getMaxMessageCount', function (done) {
request
.get('/api/getMaxMessageCount')
.get('/api/get?data=MaxMessageCount')
.expect(200, done);
});
it('GET /api/getAbsoluteMaxBytes', function (done) {
request
.get('/api/getAbsoluteMaxBytes')
.get('/api/get?data=AbsoluteMaxBytes')
.expect(200, done);
});
it('GET /api/getPreferredMaxBytes', function (done) {
request
.get('/api/getPreferredMaxBytes')
.get('/api/get?data=PreferredMaxBytes')
.expect(200, done);
});
it('GET /api/getTPS', function (done) {
request
.get('/api/getTPS')
.get('/api/get?data=TPS')
.expect(200, done);
});
it('GET / 200 result', function (done) {
Expand Down

0 comments on commit 83c3dd5

Please sign in to comment.