huyuanming
6 years ago
39 changed files with 758 additions and 146 deletions
@ -0,0 +1,15 @@
|
||||
package cn.escheduler.common.enums; |
||||
|
||||
/** |
||||
* zk node type |
||||
*/ |
||||
public enum ZKNodeType { |
||||
|
||||
/** |
||||
* 0 do not send warning; |
||||
* 1 send if process success; |
||||
* 2 send if process failed; |
||||
* 3 send if process ending; |
||||
*/ |
||||
MASTER, WORKER, DEAD_SERVER, TASK_QUEUE; |
||||
} |
@ -0,0 +1,115 @@
|
||||
<template> |
||||
<m-list-construction :title="$t('statistics') + $t('Manage')"> |
||||
<template slot="content"> |
||||
<div class="servers-wrapper mysql-model" v-show="2"> |
||||
<div class="row"> |
||||
<div class="col-md-3"> |
||||
<div class="text-num-model text"> |
||||
<div class="title"> |
||||
<span >{{$t('process number of waiting for running')}}</span> |
||||
</div> |
||||
<div class="value-p"> |
||||
<b :style="{color:color[0]}"> {{commandCountData.normalCount}}</b> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<div class="text-num-model text"> |
||||
<div class="title"> |
||||
<span >{{$t('failure command number')}}}</span> |
||||
</div> |
||||
<div class="value-p"> |
||||
<b :style="{color:color[1]}"> {{commandCountData.errorCount}}</b> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<div class="text-num-model text"> |
||||
<div class="title"> |
||||
<span >{{$t('tasks number of waiting running')}}</span> |
||||
</div> |
||||
<div class="value-p"> |
||||
<b :style="{color:color[0]}"> {{queueCount.taskQueue}}</b> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col-md-3"> |
||||
<div class="text-num-model text"> |
||||
<div class="title"> |
||||
<span >{{$t('task number of ready to kill')}}</span> |
||||
</div> |
||||
<div class="value-p"> |
||||
<b :style="{color:color[1]}">{{queueCount.taskKill}}</b> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<m-spin :is-spin="isLoading" ></m-spin> |
||||
</template> |
||||
</m-list-construction> |
||||
</template> |
||||
|
||||
<script> |
||||
import { mapActions } from 'vuex' |
||||
import mSpin from '@/module/components/spin/spin' |
||||
import mNoData from '@/module/components/noData/noData' |
||||
import themeData from '@/module/echarts/themeData.json' |
||||
import mListConstruction from '@/module/components/listConstruction/listConstruction' |
||||
|
||||
export default { |
||||
name: 'statistics', |
||||
data () { |
||||
return { |
||||
isLoading: false, |
||||
queueCount: {}, |
||||
commandCountData: {}, |
||||
color: themeData.color |
||||
} |
||||
}, |
||||
props:{}, |
||||
methods: { |
||||
//...mapActions('monitor', ['getDatabaseData']) |
||||
// ...mapActions('projects', ['getCommandStateCount']), |
||||
...mapActions('projects', ['getQueueCount']), |
||||
...mapActions('projects', ['getCommandStateCount']), |
||||
}, |
||||
watch: {}, |
||||
created () { |
||||
this.isLoading = true |
||||
this.getQueueCount().then(res => { |
||||
this.queueCount = res.data |
||||
this.isLoading = false |
||||
}).catch(() => { |
||||
this.isLoading = false |
||||
}) |
||||
|
||||
this.getCommandStateCount().then(res => { |
||||
let normal = 0 |
||||
let error = 0 |
||||
_.forEach(res.data, (v, i) => { |
||||
let key = _.keys(v) |
||||
if(key[0] == 'errorCount') { |
||||
error = error + v.errorCount |
||||
} |
||||
if(key[1] == 'normalCount'){ |
||||
normal = normal + v.normalCount |
||||
} |
||||
} |
||||
) |
||||
this.commandCountData = { |
||||
'normalCount': normal, |
||||
'errorCount' : error |
||||
} |
||||
}).catch( () => { |
||||
}) |
||||
}, |
||||
mounted () { |
||||
}, |
||||
components: { mListConstruction, mSpin, mNoData } |
||||
} |
||||
|
||||
</script> |
||||
<style lang="scss" rel="stylesheet/scss"> |
||||
@import "./servers"; |
||||
</style> |
@ -0,0 +1,41 @@
|
||||
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); |
||||
|
||||
-- ac_escheduler_T_t_escheduler_process_definition_C_tenant_id |
||||
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_process_definition_C_tenant_id; |
||||
delimiter d// |
||||
CREATE PROCEDURE ac_escheduler_T_t_escheduler_process_definition_C_tenant_id() |
||||
BEGIN |
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS |
||||
WHERE TABLE_NAME='t_escheduler_process_definition' |
||||
AND TABLE_SCHEMA=(SELECT DATABASE()) |
||||
AND COLUMN_NAME='tenant_id') |
||||
THEN |
||||
ALTER TABLE `t_escheduler_process_definition` ADD COLUMN `tenant_id` int(11) NOT NULL DEFAULT -1 COMMENT '租户id' AFTER `timeout`; |
||||
END IF; |
||||
END; |
||||
|
||||
d// |
||||
|
||||
delimiter ; |
||||
CALL ac_escheduler_T_t_escheduler_process_definition_C_tenant_id; |
||||
DROP PROCEDURE ac_escheduler_T_t_escheduler_process_definition_C_tenant_id; |
||||
|
||||
-- ac_escheduler_T_t_escheduler_process_instance_C_tenant_id |
||||
drop PROCEDURE if EXISTS ac_escheduler_T_t_escheduler_process_instance_C_tenant_id; |
||||
delimiter d// |
||||
CREATE PROCEDURE ac_escheduler_T_t_escheduler_process_instance_C_tenant_id() |
||||
BEGIN |
||||
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS |
||||
WHERE TABLE_NAME='t_escheduler_process_instance' |
||||
AND TABLE_SCHEMA=(SELECT DATABASE()) |
||||
AND COLUMN_NAME='tenant_id') |
||||
THEN |
||||
ALTER TABLE `t_escheduler_process_instance` ADD COLUMN `tenant_id` int(11) NOT NULL DEFAULT -1 COMMENT '租户id' AFTER `timeout`; |
||||
END IF; |
||||
END; |
||||
|
||||
d// |
||||
|
||||
delimiter ; |
||||
CALL ac_escheduler_T_t_escheduler_process_instance_C_tenant_id; |
||||
DROP PROCEDURE ac_escheduler_T_t_escheduler_process_instance_C_tenant_id; |
Loading…
Reference in new issue