|
|
@ -86,7 +86,7 @@ monitor.processes.render = function(label,data) {
|
|
|
|
{ name: 'label', type: 'text', title: "Process", headercss: "small bold", css: "small"},
|
|
|
|
{ name: 'label', type: 'text', title: "Process", headercss: "small bold", css: "small"},
|
|
|
|
{ name: "cpu_usage", type: "number", title: "CPU", headercss: "small bold" , width:'64px'},
|
|
|
|
{ name: "cpu_usage", type: "number", title: "CPU", headercss: "small bold" , width:'64px'},
|
|
|
|
{ name: "memory_usage", type: "text", title: "Mem. Used", type: "number", headercss: "small bold" },
|
|
|
|
{ name: "memory_usage", type: "text", title: "Mem. Used", type: "number", headercss: "small bold" },
|
|
|
|
{ name: "memory_available", type: "number", title: "Mem. Avail", headercss: "small bold" },
|
|
|
|
{ name: "proc_count", type: "number", title: "Proc Count", headercss: "small bold" },
|
|
|
|
{name:"status",type:"text",title:"Status",headercss:"small bold",align:"center", width:'64px'}
|
|
|
|
{name:"status",type:"text",title:"Status",headercss:"small bold",align:"center", width:'64px'}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
var grid = $('#latest_processes').jsGrid(options) ;
|
|
|
|
var grid = $('#latest_processes').jsGrid(options) ;
|
|
|
@ -127,7 +127,10 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
conf.data = {}
|
|
|
|
conf.data = {}
|
|
|
|
conf.options = { legend: { position: 'bottom' } }
|
|
|
|
conf.options = { legend: { position: 'bottom' } }
|
|
|
|
conf.options.scales = {}
|
|
|
|
conf.options.scales = {}
|
|
|
|
conf.options.scales.yAxes = [ {scaleLabel:{display:true,labelString:'CPU & MEMORY USAGE'},ticks:{min:0,beginAtZero:true},gridLines: {display:false}}]
|
|
|
|
conf.options.scales.yAxes = [
|
|
|
|
|
|
|
|
{id:'0',scaleLabel:{display:true,labelString:'CPU & MEMORY USAGE'},ticks:{min:0,beginAtZero:true},gridLines: {display:false}},
|
|
|
|
|
|
|
|
{id:'1',position:'right',scaleLabel:{display:true,labelString:'PROCESS COUNT'},ticks:{min:0,stepSize:1,beginAtZero:true},gridLines: {display:false}}
|
|
|
|
|
|
|
|
]
|
|
|
|
conf.options.scales.xAxes = [
|
|
|
|
conf.options.scales.xAxes = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
@ -145,8 +148,9 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
var x_axis = []
|
|
|
|
var x_axis = []
|
|
|
|
var _x = {}
|
|
|
|
var _x = {}
|
|
|
|
// var _y = {}
|
|
|
|
// var _y = {}
|
|
|
|
var cpu = { label: 'CPU Usage (%)', data: [] ,backgroundColor:'transparent',borderColor:COLORS[187],fill:false,borderWidth:1}
|
|
|
|
var cpu = {yAxisID:'0', label: 'CPU Usage (%)', data: [] ,backgroundColor:'transparent',borderColor:COLORS[187],fill:false,borderWidth:1}
|
|
|
|
var mem = {label : 'Memory Usage(%)',data:[],backgroundColor:'transparent',borderColor:COLORS[32],fill:false,borderWidth:1}
|
|
|
|
var mem = {yAxisID:'0',label : 'Memory Usage(%)',data:[],backgroundColor:'transparent',borderColor:COLORS[32],fill:false,borderWidth:1}
|
|
|
|
|
|
|
|
var proc= {yAxisID:'1',label : 'Proc Count',data:[],backgroundColor:'transparent',borderColor:COLORS[42],fill:false,borderWidth:1}
|
|
|
|
jx.utils.patterns.visitor(logs,function(item){
|
|
|
|
jx.utils.patterns.visitor(logs,function(item){
|
|
|
|
x = new Date(item.year,item.month-1,item.day,item.hour,item.minute)
|
|
|
|
x = new Date(item.year,item.month-1,item.day,item.hour,item.minute)
|
|
|
|
y = item[key]
|
|
|
|
y = item[key]
|
|
|
@ -156,6 +160,7 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
x_axis.push(x)
|
|
|
|
x_axis.push(x)
|
|
|
|
cpu.data.push({ x: x, y: item.cpu_usage })
|
|
|
|
cpu.data.push({ x: x, y: item.cpu_usage })
|
|
|
|
mem.data.push({x:x,y:item.memory_usage})
|
|
|
|
mem.data.push({x:x,y:item.memory_usage})
|
|
|
|
|
|
|
|
proc.data.push({x:x,y:item.proc_count})
|
|
|
|
// return {x:x,y:y}
|
|
|
|
// return {x:x,y:y}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -164,7 +169,7 @@ monitor.processes.trend.render = function (logs, key,label) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
conf.data.datasets = [cpu,mem]
|
|
|
|
conf.data.datasets = [cpu,mem,proc]
|
|
|
|
x_axis = jx.utils.unique(x_axis)
|
|
|
|
x_axis = jx.utils.unique(x_axis)
|
|
|
|
conf.data.labels = x_axis
|
|
|
|
conf.data.labels = x_axis
|
|
|
|
// console.log(conf)
|
|
|
|
// console.log(conf)
|
|
|
@ -337,4 +342,4 @@ monitor.sandbox.render = function (logs) {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Socket handler, check for learning status
|
|
|
|
* Socket handler, check for learning status
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|