This commit is contained in:
2020-06-02 15:59:29 +00:00
parent 857644fada
commit 583fde9fd0
2 changed files with 52 additions and 35 deletions

View File

@@ -55,9 +55,10 @@
/> />
</v-sheet> </v-sheet>
</v-col> </v-col>
<v-col cols="12" class="my-1"> <v-col cols="3" class="my-1">
{{ dbTopTablesChartData }}
<v-sheet elevation="4"> <v-sheet elevation="4">
<gz-chart-pie :chartData="dbTopTenChartData" /> <gz-chart-pie :chartData="dbTopTablesChartData" />
</v-sheet> </v-sheet>
</v-col> </v-col>
</v-tab-item> </v-tab-item>
@@ -102,7 +103,7 @@ import relativeDatefilterCalculator from "../api/relative-date-filter-calculator
const FORM_KEY = "ops-metrics"; const FORM_KEY = "ops-metrics";
//Pleasing combo of contrasting colors for lines //Pleasing combo of contrasting colors for lines
//from http://perceptualedge.com/articles/b-eye/choosing_colors.pdf //from http://perceptualedge.com/articles/b-eye/choosing_colors.pdf
const CHART_COLOR = { const CHART_PALETTE = {
blue: "#1f77b4", blue: "#1f77b4",
red: "#d62728", red: "#d62728",
orange: "#fe7f0e", orange: "#fe7f0e",
@@ -291,7 +292,7 @@ export default {
datasets: [ datasets: [
{ {
label: "CPU %", label: "CPU %",
borderColor: CHART_COLOR.teal, borderColor: CHART_PALETTE.teal,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -306,7 +307,7 @@ export default {
datasets: [ datasets: [
{ {
label: "DB Size (MB)", label: "DB Size (MB)",
borderColor: CHART_COLOR.blue, borderColor: CHART_PALETTE.blue,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -316,27 +317,22 @@ export default {
] ]
}; };
}, },
dbTopTenChartData() { dbTopTablesChartData() {
// debugger;
return { return {
// These labels appear in the legend and in the tooltips when hovering different arcs
//_.map(users, 'user');
labels: window.$gz._.map(this.db.topTables, "name"),
datasets: [ datasets: [
{ {
data: [10, 20, 30] label: "Table size (MB)",
data: window.$gz._.map(this.db.topTables, "value"),
backgroundColor: getPalette(
this.db.topTables ? this.db.topTables.length : 3
)
// getPalette( this.db.topTables ? this.db.topTables.length : 3 )
} }
], ]
// These labels appear in the legend and in the tooltips when hovering different arcs
labels: ["Red", "Yellow", "Blue"]
// datasets: [
// {
// label: "Table size (MB)",
// borderColor: CHART_COLOR.blue,
// fill: false,
// radius: 0,
// hoverRadius: 10,
// hitRadius: 4,
// data: this.db.topTen
// }
// ]
}; };
}, },
gcAllChartData() { gcAllChartData() {
@@ -344,7 +340,7 @@ export default {
datasets: [ datasets: [
{ {
label: "GC Gen0", label: "GC Gen0",
borderColor: CHART_COLOR.blue, borderColor: CHART_PALETTE.blue,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -353,7 +349,7 @@ export default {
}, },
{ {
label: "GC Gen1", label: "GC Gen1",
borderColor: CHART_COLOR.red, borderColor: CHART_PALETTE.red,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -362,7 +358,7 @@ export default {
}, },
{ {
label: "GC Gen2", label: "GC Gen2",
borderColor: CHART_COLOR.green, borderColor: CHART_PALETTE.green,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -377,7 +373,7 @@ export default {
datasets: [ datasets: [
{ {
label: "Allocated (MB)", label: "Allocated (MB)",
borderColor: CHART_COLOR.purple, borderColor: CHART_PALETTE.purple,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -386,7 +382,7 @@ export default {
}, },
{ {
label: "Working set (MB)", label: "Working set (MB)",
borderColor: CHART_COLOR.green, borderColor: CHART_PALETTE.green,
//borderWidth:4, //borderWidth:4,
// pointStyle: "rectRot", // pointStyle: "rectRot",
radius: 0, radius: 0,
@@ -398,7 +394,7 @@ export default {
}, },
{ {
label: "Private (MB)", label: "Private (MB)",
borderColor: CHART_COLOR.orange, borderColor: CHART_PALETTE.orange,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -413,7 +409,7 @@ export default {
datasets: [ datasets: [
{ {
label: "Attachments (MB)", label: "Attachments (MB)",
borderColor: CHART_COLOR.purple, borderColor: CHART_PALETTE.purple,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -423,7 +419,7 @@ export default {
{ {
label: "Available space (MB)", label: "Available space (MB)",
borderColor: CHART_COLOR.green, borderColor: CHART_PALETTE.green,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -438,7 +434,7 @@ export default {
datasets: [ datasets: [
{ {
label: "Backup (MB)", label: "Backup (MB)",
borderColor: CHART_COLOR.orange, borderColor: CHART_PALETTE.orange,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -448,7 +444,7 @@ export default {
{ {
label: "Available space (MB)", label: "Available space (MB)",
borderColor: CHART_COLOR.green, borderColor: CHART_PALETTE.green,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -463,7 +459,7 @@ export default {
datasets: [ datasets: [
{ {
label: "Attachment files", label: "Attachment files",
borderColor: CHART_COLOR.purple, borderColor: CHART_PALETTE.purple,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -473,7 +469,7 @@ export default {
{ {
label: "Backup files", label: "Backup files",
borderColor: CHART_COLOR.orange, borderColor: CHART_PALETTE.orange,
fill: false, fill: false,
radius: 0, radius: 0,
hoverRadius: 10, hoverRadius: 10,
@@ -486,6 +482,27 @@ export default {
} }
}; };
///////////////////////
//
function getPalette(size) {
let palette = [
CHART_PALETTE.blue,
CHART_PALETTE.red,
CHART_PALETTE.green,
CHART_PALETTE.orange,
CHART_PALETTE.purple,
CHART_PALETTE.cyan,
CHART_PALETTE.teal,
CHART_PALETTE.black
];
let paletteLength = palette.length;
let ret = [];
for (let i = 0; i < size; i++) {
ret.push(palette[i % paletteLength]);
}
return ret;
}
////////////////////// //////////////////////
// //
// //

View File

@@ -8,7 +8,7 @@
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<v-card elevation="4"> <v-card elevation="4">
<v-card :height="cardHeight" > <v-card :height="cardHeight">
<iframe <iframe
id="profileFrame" id="profileFrame"
style="width:100%;height:100%" style="width:100%;height:100%"