mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 12:59:06 +01:00
Remove comments
This commit is contained in:
parent
0c1b66aad9
commit
68a839bf1c
@ -287,12 +287,8 @@ func (r *subClusterResolver) NumberOfNodes(ctx context.Context, obj *schema.SubC
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
// log.Debugf(">>>> See raw list definition here: %v", nodeList)
|
|
||||||
stringList := nodeList.PrintList()
|
stringList := nodeList.PrintList()
|
||||||
// log.Debugf(">>>> See parsed list here: %v", stringList)
|
return len(stringList), nil
|
||||||
numOfNodes := len(stringList)
|
|
||||||
// log.Debugf(">>>> See numOfNodes here: %v", len(stringList))
|
|
||||||
return numOfNodes, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cluster returns generated.ClusterResolver implementation.
|
// Cluster returns generated.ClusterResolver implementation.
|
||||||
|
@ -40,23 +40,15 @@ func (nl *NodeList) Contains(name string) bool {
|
|||||||
func (nl *NodeList) PrintList() []string {
|
func (nl *NodeList) PrintList() []string {
|
||||||
var out []string
|
var out []string
|
||||||
for _, term := range *nl {
|
for _, term := range *nl {
|
||||||
// log.Debugf("Term: %v", term)
|
|
||||||
|
|
||||||
prefix := term[0].prefix()
|
prefix := term[0].prefix()
|
||||||
// log.Debugf("Prefix as String: %s", prefix)
|
|
||||||
|
|
||||||
limitArr := term[1].limits()
|
limitArr := term[1].limits()
|
||||||
for _, inner := range limitArr {
|
for _, inner := range limitArr {
|
||||||
for i := inner["start"]; i < inner["end"]+1; i++ {
|
for i := inner["start"]; i < inner["end"]+1; i++ {
|
||||||
node := fmt.Sprintf("%s%02d", prefix, i)
|
node := fmt.Sprintf("%s%02d", prefix, i)
|
||||||
out = append(out, node)
|
out = append(out, node)
|
||||||
}
|
}
|
||||||
// log.Debugf("Inner Map @ %d: %#v", indx, inner)
|
|
||||||
// log.Debugf("Start: %#v", inner["start"])
|
|
||||||
// log.Debugf("End: %#v", inner["end"])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// log.Debugf("Node List as Strings: %#v", out)
|
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +87,6 @@ func (nles NLExprIntRanges) limits() []map[string]int64 {
|
|||||||
l := make([]map[string]int64, 0)
|
l := make([]map[string]int64, 0)
|
||||||
for _, nle := range nles {
|
for _, nle := range nles {
|
||||||
inner := nle.limits()
|
inner := nle.limits()
|
||||||
// log.Debugf("limits @ nles: %#v", inner)
|
|
||||||
l = append(l, inner[0])
|
l = append(l, inner[0])
|
||||||
}
|
}
|
||||||
return l
|
return l
|
||||||
@ -146,7 +137,6 @@ func (nle NLExprIntRange) limits() []map[string]int64 {
|
|||||||
m["start"] = nle.start
|
m["start"] = nle.start
|
||||||
m["end"] = nle.end
|
m["end"] = nle.end
|
||||||
l = append(l, m)
|
l = append(l, m)
|
||||||
// log.Debugf("limits @ nle: %#v", l)
|
|
||||||
return l
|
return l
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,23 +18,11 @@
|
|||||||
let selectedHost = null, plot, fetching = false, error = null
|
let selectedHost = null, plot, fetching = false, error = null
|
||||||
let selectedScope = minScope(scopes)
|
let selectedScope = minScope(scopes)
|
||||||
let selectedScopeIndex = scopes.findIndex(s => s == selectedScope)
|
let selectedScopeIndex = scopes.findIndex(s => s == selectedScope)
|
||||||
|
|
||||||
// console.log('- Inputs -')
|
|
||||||
// console.log(metricName)
|
|
||||||
// console.log(scopes)
|
|
||||||
// console.log(rawData)
|
|
||||||
// console.log('- Prep Scopes -')
|
|
||||||
// console.log(selectedScope)
|
|
||||||
// console.log(selectedScopeIndex)
|
|
||||||
|
|
||||||
$: avaliableScopes = scopes
|
$: avaliableScopes = scopes
|
||||||
$: data = rawData[selectedScopeIndex]
|
$: data = rawData[selectedScopeIndex]
|
||||||
$: series = data?.series.filter(series => selectedHost == null || series.hostname == selectedHost)
|
$: series = data?.series.filter(series => selectedHost == null || series.hostname == selectedHost)
|
||||||
|
|
||||||
// console.log('- Prep Data -')
|
|
||||||
// console.log(rawData[selectedScopeIndex])
|
|
||||||
// console.log(rawData[selectedScopeIndex].series.filter(series => selectedHost == null || series.hostname == selectedHost))
|
|
||||||
|
|
||||||
let from = null, to = null
|
let from = null, to = null
|
||||||
export function setTimeRange(f, t) {
|
export function setTimeRange(f, t) {
|
||||||
from = f, to = t
|
from = f, to = t
|
||||||
|
@ -60,19 +60,13 @@
|
|||||||
// SubCluster Config present: Check if remove flag is set
|
// SubCluster Config present: Check if remove flag is set
|
||||||
if (thisConfig.subClusters[thisSCIndex].remove == true) {
|
if (thisConfig.subClusters[thisSCIndex].remove == true) {
|
||||||
// Return null data and informational flag
|
// Return null data and informational flag
|
||||||
// console.log('Case 1.1 -> Returned')
|
|
||||||
// console.log({removed: true, data: null})
|
|
||||||
return {removed: true, data: null}
|
return {removed: true, data: null}
|
||||||
} else {
|
} else {
|
||||||
// load and return metric, if data available
|
// load and return metric, if data available
|
||||||
let thisMetric = jobMetrics.filter(jobMetric => jobMetric.name == name) // Returns Array
|
let thisMetric = jobMetrics.filter(jobMetric => jobMetric.name == name) // Returns Array
|
||||||
if (thisMetric.length > 0) {
|
if (thisMetric.length > 0) {
|
||||||
// console.log('Case 1.2.1 -> Returned')
|
|
||||||
// console.log({removed: false, data: thisMetric})
|
|
||||||
return {removed: false, data: thisMetric}
|
return {removed: false, data: thisMetric}
|
||||||
} else {
|
} else {
|
||||||
// console.log('Case 1.2.2 -> Returned:')
|
|
||||||
// console.log({removed: false, data: null})
|
|
||||||
return {removed: false, data: null}
|
return {removed: false, data: null}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,26 +74,15 @@
|
|||||||
// No specific subCluster config: 'remove' flag not set, deemed false -> load and return metric, if data available
|
// No specific subCluster config: 'remove' flag not set, deemed false -> load and return metric, if data available
|
||||||
let thisMetric = jobMetrics.filter(jobMetric => jobMetric.name == name) // Returns Array
|
let thisMetric = jobMetrics.filter(jobMetric => jobMetric.name == name) // Returns Array
|
||||||
if (thisMetric.length > 0) {
|
if (thisMetric.length > 0) {
|
||||||
// console.log('Case 2.1 -> Returned')
|
|
||||||
// console.log({removed: false, data: thisMetric})
|
|
||||||
return {removed: false, data: thisMetric}
|
return {removed: false, data: thisMetric}
|
||||||
} else {
|
} else {
|
||||||
// console.log('Case 2.2 -> Returned')
|
|
||||||
// console.log({removed: false, data: null})
|
|
||||||
return {removed: false, data: null}
|
return {removed: false, data: null}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map(function(jobMetrics) {
|
.map(function(jobMetrics) {
|
||||||
if (jobMetrics.data != null && jobMetrics.data.length > 0) {
|
if (jobMetrics.data != null && jobMetrics.data.length > 0) {
|
||||||
// console.log('Before')
|
return {removed: jobMetrics.removed, data: selectScope(jobMetrics.data)}
|
||||||
// console.log(jobMetrics.data)
|
|
||||||
// console.log('After')
|
|
||||||
// console.log(selectScope(jobMetrics.data))
|
|
||||||
let res = {removed: jobMetrics.removed, data: selectScope(jobMetrics.data)}
|
|
||||||
// console.log('Packed')
|
|
||||||
// console.log(res)
|
|
||||||
return res
|
|
||||||
} else {
|
} else {
|
||||||
return jobMetrics
|
return jobMetrics
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user