mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-20 17:57:30 +01:00
Merge pull request #492 from ClusterCockpit/dev
Add log output and fix bugs in AppTagger
This commit is contained in:
@@ -52,7 +52,10 @@ func (t *AppTagger) scanApp(f *os.File, fns string) {
|
||||
ai := appInfo{tag: tag, patterns: make([]*regexp.Regexp, 0)}
|
||||
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
line := strings.TrimSpace(scanner.Text())
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
re, err := regexp.Compile(line)
|
||||
if err != nil {
|
||||
cclog.Errorf("invalid regex pattern '%s' in %s: %v", line, fns, err)
|
||||
@@ -68,6 +71,8 @@ func (t *AppTagger) scanApp(f *os.File, fns string) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
cclog.Infof("AppTagger loaded %d patterns for %s", len(ai.patterns), tag)
|
||||
t.apps = append(t.apps, ai)
|
||||
}
|
||||
|
||||
@@ -86,6 +91,9 @@ func (t *AppTagger) EventCallback() {
|
||||
}
|
||||
|
||||
for _, fn := range files {
|
||||
if fn.IsDir() {
|
||||
continue
|
||||
}
|
||||
fns := fn.Name()
|
||||
cclog.Debugf("Process: %s", fns)
|
||||
f, err := os.Open(filepath.Join(t.cfgPath, fns))
|
||||
@@ -121,6 +129,9 @@ func (t *AppTagger) Register() error {
|
||||
}
|
||||
|
||||
for _, fn := range files {
|
||||
if fn.IsDir() {
|
||||
continue
|
||||
}
|
||||
fns := fn.Name()
|
||||
cclog.Debugf("Process: %s", fns)
|
||||
f, err := os.Open(filepath.Join(t.cfgPath, fns))
|
||||
@@ -164,8 +175,8 @@ func (t *AppTagger) Match(job *schema.Job) {
|
||||
if re.MatchString(jobscriptLower) {
|
||||
if !r.HasTag(id, t.tagType, a.tag) {
|
||||
r.AddTagOrCreateDirect(id, t.tagType, a.tag)
|
||||
break out
|
||||
}
|
||||
break out
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,11 +276,11 @@
|
||||
<Row>
|
||||
<Col>
|
||||
<Card>
|
||||
<Table hover>
|
||||
<Table hover responsive>
|
||||
<thead>
|
||||
<!-- Header Row 1: Titles and Sorting -->
|
||||
<tr>
|
||||
<th style="width:10%; max-width:12.5%;" onclick={() => sortBy('hostname')}>
|
||||
<th style="width: 7.5%; min-width: 100px; max-width:10%;" onclick={() => sortBy('hostname')}>
|
||||
Host
|
||||
<Icon
|
||||
name="caret-{healthTableSorting['hostname'].dir}{healthTableSorting['hostname']
|
||||
@@ -289,7 +289,7 @@
|
||||
: ''}"
|
||||
/>
|
||||
</th>
|
||||
<th style="width:10%; max-width:12.5%;" onclick={() => sortBy('schedulerState')}>
|
||||
<th style="width: 8.5%; min-width: 100px; max-width:10%;" onclick={() => sortBy('schedulerState')}>
|
||||
Scheduler State
|
||||
<Icon
|
||||
name="caret-{healthTableSorting['schedulerState'].dir}{healthTableSorting['schedulerState']
|
||||
@@ -298,7 +298,7 @@
|
||||
: ''}"
|
||||
/>
|
||||
</th>
|
||||
<th style="width:10%; max-width:12.5%;" onclick={() => sortBy('healthState')}>
|
||||
<th style="width: 7.5%; min-width: 100px; max-width:10%;" onclick={() => sortBy('healthState')}>
|
||||
Health State
|
||||
<Icon
|
||||
name="caret-{healthTableSorting['healthState'].dir}{healthTableSorting['healthState']
|
||||
@@ -343,17 +343,17 @@
|
||||
<tbody>
|
||||
{#each filteredTableData as host (host.hostname)}
|
||||
<tr>
|
||||
<th><b><a href="/monitoring/node/{cluster}/{host.hostname}" target="_blank">{host.hostname}</a></b></th>
|
||||
<th scope="row"><b><a href="/monitoring/node/{cluster}/{host.hostname}" target="_blank">{host.hostname}</a></b></th>
|
||||
<td>{host.schedulerState}</td>
|
||||
<td>{host.healthState}</td>
|
||||
<td>
|
||||
<td style="max-width: 250px;">
|
||||
{#each Object.keys(host.healthData) as hkey}
|
||||
<p>
|
||||
<b>{hkey}</b>: {host.healthData[hkey]}
|
||||
</p>
|
||||
{/each}
|
||||
</td>
|
||||
<td>
|
||||
<td style="max-width: 250px;">
|
||||
{#each Object.keys(host.metaData) as mkey}
|
||||
<p>
|
||||
<b>{mkey}</b>: {host.metaData[mkey]}
|
||||
|
||||
Reference in New Issue
Block a user