mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-14 02:37:25 +01:00
cleanup dev logging
This commit is contained in:
parent
e4f8022b7a
commit
613e128cab
@ -88,25 +88,20 @@
|
|||||||
const dbid = job.id;
|
const dbid = job.id;
|
||||||
const selectedMetrics = [metricName]
|
const selectedMetrics = [metricName]
|
||||||
|
|
||||||
$: if (selectedScope == "load-all" || pendingResolution) {
|
$: if (selectedScope || pendingResolution) {
|
||||||
|
|
||||||
if (selectedScope == "load-all") {
|
if (selectedScope == "load-all") {
|
||||||
console.log('Triggered load-all')
|
|
||||||
selectedScopes = [...scopes, "socket", "core"]
|
selectedScopes = [...scopes, "socket", "core"]
|
||||||
} else {
|
|
||||||
console.log("Triggered scope switch:", selectedScope, pendingResolution)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// What if accelerator scope / native core scopes?
|
// What if accelerator scope / native core scopes?
|
||||||
if ((selectedResolution !== pendingResolution) && selectedScopes.length >= 2) {
|
if ((selectedResolution !== pendingResolution) && selectedScopes.length >= 2) {
|
||||||
selectedScope = String("node")
|
selectedScope = String("node")
|
||||||
selectedScopes = ["node"]
|
selectedScopes = ["node"]
|
||||||
console.log("New Resolution: Reset to node scope")
|
|
||||||
} else {
|
|
||||||
console.log("New Resolution: No change in Res or just node scope")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!selectedResolution) {
|
if (!selectedResolution) {
|
||||||
|
// Skips reactive data load on init
|
||||||
selectedResolution = Number(pendingResolution)
|
selectedResolution = Number(pendingResolution)
|
||||||
} else {
|
} else {
|
||||||
selectedResolution = Number(pendingResolution)
|
selectedResolution = Number(pendingResolution)
|
||||||
@ -115,31 +110,25 @@
|
|||||||
client: client,
|
client: client,
|
||||||
query: subQuery,
|
query: subQuery,
|
||||||
variables: { dbid, selectedMetrics, selectedScopes, selectedResolution },
|
variables: { dbid, selectedMetrics, selectedScopes, selectedResolution },
|
||||||
// requestPolicy: "network-only",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($metricData && !$metricData.fetching) {
|
if ($metricData && !$metricData.fetching) {
|
||||||
console.log('Trigger Data Handling')
|
|
||||||
|
|
||||||
rawData = $metricData.data.singleUpdate.map((x) => x.metric)
|
rawData = $metricData.data.singleUpdate.map((x) => x.metric)
|
||||||
scopes = $metricData.data.singleUpdate.map((x) => x.scope)
|
scopes = $metricData.data.singleUpdate.map((x) => x.scope)
|
||||||
statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null)
|
statsSeries = rawData.map((data) => data?.statisticsSeries ? data.statisticsSeries : null)
|
||||||
|
|
||||||
// Handle Selected Scope on load-all
|
// Set selected scope to min of returned scopes
|
||||||
if (selectedScope == "load-all") {
|
if (selectedScope == "load-all") {
|
||||||
selectedScope = minScope(scopes)
|
selectedScope = minScope(scopes)
|
||||||
console.log('Set New SelectedScope after Load-All', selectedScope, scopes)
|
|
||||||
} else {
|
|
||||||
console.log('Set New SelectedScope', selectedScope)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
patternMatches = statsPattern.exec(selectedScope)
|
patternMatches = statsPattern.exec(selectedScope)
|
||||||
|
|
||||||
if (!patternMatches) {
|
if (!patternMatches) {
|
||||||
selectedScopeIndex = scopes.findIndex((s) => s == selectedScope);
|
selectedScopeIndex = scopes.findIndex((s) => s == selectedScope);
|
||||||
console.log("Selected Index # from Array", selectedScopeIndex, scopes)
|
|
||||||
} else {
|
} else {
|
||||||
selectedScopeIndex = scopes.findIndex((s) => s == patternMatches[1]);
|
selectedScopeIndex = scopes.findIndex((s) => s == patternMatches[1]);
|
||||||
console.log("Selected Stats Index # from Array", selectedScopeIndex, scopes)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user