Commit 266255a2 authored by 姚广胤's avatar 姚广胤

启用task

parent 608f0ac6
......@@ -2,7 +2,7 @@
* @Author: ygy
* @Date: 2018-03-14 19:40:01
* @Last Modified by: ygy
* @Last Modified time: 2018-03-16 14:50:17
* @Last Modified time: 2018-03-22 20:38:08
*/
const Koa = require('koa');
const send = require('koa-send');
......@@ -62,7 +62,7 @@ app.use(router());
const schedule = require('node-schedule');
const j = schedule.scheduleJob({ hour: 16 }, function() {
const j = schedule.scheduleJob({ hour: 4 }, function() {
console.log('执行任务开始');
task.runTiming();
console.log('执行任务结束');
......
......@@ -4,7 +4,7 @@ var config = {
database: 'fed_pf_test', // 使用哪个数据库
username: 'fed', // 用户名
password: 'tuia123', // 口令
host: '172.16.80.91', // 主机名
host: '172.16.80.122', // 主机名
port: 3306 // 端口号,MySQL默认3306
},
cookie: {
......
{
"name": "ali-oss-service",
"description": "aiyun oss web tool",
"version": "2.0.0",
"name": "warden",
"description": "an automate performance watcher",
"version": "1.0.0",
"main": "app.js",
"scripts": {
"dev": "export NODE_ENV=development && nodemon --harmony app.js",
......@@ -18,10 +18,6 @@
{
"email": "ygy@duiba.com.cn",
"name": "ygy"
},
{
"email": "fxt@duiba.com.cn",
"name": "方雄韬"
}
],
"license": "MIT",
......
......@@ -2,6 +2,16 @@ const historyDAO = require('../dao/historyDAO');
let findAllPagination = async(path = '', pageSize = 20, currentPage = 1) => {
let logs = await historyDAO.findAllPagination(path, pageSize, currentPage);
console.log(logs.rows);
const {
rows
} = logs;
rows && rows.forEach(item => {
item.result = JSON.parse(item.result);
});
let data;
if (logs) {
data = {
......
......@@ -2,7 +2,7 @@
* @Author: ygy
* @Date: 2018-03-14 19:39:46
* @Last Modified by: ygy
* @Last Modified time: 2018-03-16 12:01:32
* @Last Modified time: 2018-03-22 20:34:40
*/
const historyService = require('../services/historyService');
......@@ -18,7 +18,7 @@ const runTiming = async () => {
}
];
await timing.iterateTimes(urls, 100);
await timing.iterateTimes(urls, 10);
const resultToSave = urls[0]['arr'];
const total = resultToSave.reduce((item, index) => {
......
......@@ -10,7 +10,7 @@
<body style="background-repeat:no-repeat; background-attachment:fixed;background-size:cover;background-image: url(https://img.xjh.me/random_img.php?type=bg&ctype=nature&return=302);">
<div id="app"></div>
<script src="http://localhost:8086/dist/public.js"></script>
<script src="http://localhost:5001/dist/public.js"></script>
</body>
</html>
......@@ -11,7 +11,7 @@
<body style="background-repeat:no-repeat; background-attachment:fixed;background-size:cover;background-image: url(//yun.duiba.com.cn/tuia/cdn/background-logo.jpg);">
<div id="app"></div>
<script src="http://localhost:8086/dist/private.js"></script>
<script src="http://localhost:5001/dist/private.js"></script>
</body>
</html>
......@@ -25,7 +25,7 @@ module.exports = {
entry: entryList,
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: process.env.NODE_ENV === 'production' ? 'http://yun.dui88.com/tuia/cdn/' : '/dist' ,
publicPath: process.env.NODE_ENV === 'production' ? 'http://yun.dui88.com/tuia/cdn/' : '/dist/' ,
filename: '[name].js'
},
resolve: {
......
{
"name": "web",
"description": "aiyun oss web tool",
"version": "2.0.0",
"name": "warden",
"description": "an automate performance watcher",
"version": "1.0.0",
"author": "jsholic <junhe0723@gmail.com>",
"contributors": [
{
"email": "ygy@duiba.com.cn",
"name": "ygy"
},
{
"email": "fxt@duiba.com.cn",
"name": "方雄韬"
}
],
"scripts": {
......
<template lang="html">
<el-menu :default-active="activeIndex" mode="horizontal" router>
<h2 class="nav-title"><img class="logo" src="//yun.tuiapple.com/tuia/cdn/heave-logo-small.png" alt=""></h2>
<el-menu-item index="home">上传测试</el-menu-item>
<el-menu-item index="list">同步生产</el-menu-item>
<el-menu-item index="home">性能数据</el-menu-item>
<li class="tip-pane">
<span class="name">{{userName}}</span>
<span class="separator">|</span>
......
<template lang="html">
<div>
<div class="chart-tool">
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in options"
......@@ -84,17 +84,25 @@ export default {
axios
.get('/history/list')
.then(response => {
this.initChart(response.data.data);
const {
data
} = response.data;
const days = data.map(item => item['day']);
const seriesData = data.map(item => item['result']['all']);
this.initChart(days, seriesData);
})
.catch(error => {
console.log(error);
});
},
initChart(data) {
initChart(days, seriesData) {
this.chart = echarts.init(this.$refs.myEchart);
const xData = data.map(item => item[0]);
const yData = data.map(item => item[1]);
const xData = days;
const yData = seriesData;
console.log(xData, yData);
var option = {
......@@ -153,5 +161,7 @@ export default {
</script>
<style lang="css">
.chart-tool {
margin-top: 30px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment