Skip to content

Commit

Permalink
To reproduce hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
katarzyna-z committed Aug 29, 2016
1 parent c4a90dd commit a79c0a0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ func getStats(path string, stats map[string]map[string]interface{}, prevMetricsS
return err
}

fmt.Fprintf(os.Stderr, "Percentage value of %v could not be calculated due to invalid data reported by /proc/stat", getNamespaceMetricPart(metricName, percentageRepresentationType))

if percVal := float64(100 * (currVal - prevVal) / diffSum); percVal < 0 {
fmt.Fprintf(os.Stderr, "Percentage value of %v could not be calculated due to invalid data reported by /proc/stat", getNamespaceMetricPart(metricName, percentageRepresentationType))
} else {
Expand Down

0 comments on commit a79c0a0

Please sign in to comment.