Skip to content

Commit

Permalink
Adding split chars for windows vs linux
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Mar 16, 2022
1 parent 978af3b commit 624e205
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion inspector/docker_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,15 @@ type DockerStats struct {
// Parse : run custom parsing on output of the command
func (i *DockerStats) Parse(output string) {
var values []DockerStatsMetrics
var splitChars string
details := (*i.Driver).GetDetails()
if details.IsWindows {
splitChars = "\r\n"
} else {
splitChars = "\n"
}
log.Debug("Parsing ouput string in DockerStats inspector")
lines := strings.Split(output, "\n")
lines := strings.Split(output, splitChars)
for index, line := range lines {
// skip title line
if index == 0 {
Expand Down

0 comments on commit 624e205

Please sign in to comment.