Skip to content

Commit

Permalink
fix AMD TMA chart
Browse files Browse the repository at this point in the history
  • Loading branch information
harp-intel committed Jan 23, 2025
1 parent c08cae6 commit 4f5a2ca
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/metrics/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func (m *metricsFromCSV) getHTML() (html string, err error) {

// hack to determine the architecture of the metrics source
var archIndex int
if _, ok := stats["metric_Macro-ops Retired"]; ok { // a metric that only exists in the AMD metric definitions
if _, ok := stats["Macro-ops Retired"]; ok { // a metric that only exists in the AMD metric definitions
archIndex = 1
} else {
archIndex = 0
Expand Down Expand Up @@ -288,10 +288,11 @@ func (m *metricsFromCSV) getHTML() (html string, err error) {
for _, tmpl := range templateReplace {
// confirm that the metric name exists in the stats, otherwise set it to 0
var metricVal float64
if _, ok := stats[tmpl.metricNames[archIndex]]; ok {
metricVal = stats[tmpl.metricNames[archIndex]].mean
} else {
metricVal = 0
metricVal = 0
if len(tmpl.metricNames) > archIndex {
if _, ok := stats[tmpl.metricNames[archIndex]]; ok {
metricVal = stats[tmpl.metricNames[archIndex]].mean
}
}
html = strings.Replace(html, tmpl.tmplVar, fmt.Sprintf("%f", metricVal), -1)
}
Expand Down

0 comments on commit 4f5a2ca

Please sign in to comment.