Skip to content

Commit

Permalink
temporary fix for elastic#3580
Browse files Browse the repository at this point in the history
  • Loading branch information
pnagy committed Jun 15, 2017
1 parent fab03dc commit 90e7198
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion metricbeat/module/docker/memory/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,20 @@ func (s *MemoryService) getMemoryStatsList(rawStats []docker.Stat) []MemoryData
}

func (s *MemoryService) GetMemoryStats(myRawStat docker.Stat) MemoryData {
memLimit := float64(myRawStat.Stats.MemoryStats.Limit)
totalRss := float64(myRawStat.Stats.MemoryStats.Stats.TotalRss)
var totalRssP float64 = 0
if memLimit != 0 {
totalRssP = totalRss / memLimit
}
return MemoryData{
Time: common.Time(myRawStat.Stats.Read),
Container: docker.NewContainer(&myRawStat.Container),
Failcnt: myRawStat.Stats.MemoryStats.Failcnt,
Limit: myRawStat.Stats.MemoryStats.Limit,
MaxUsage: myRawStat.Stats.MemoryStats.MaxUsage,
TotalRss: myRawStat.Stats.MemoryStats.Stats.TotalRss,
TotalRssP: float64(myRawStat.Stats.MemoryStats.Stats.TotalRss) / float64(myRawStat.Stats.MemoryStats.Limit),
TotalRssP: totalRssP,
Usage: myRawStat.Stats.MemoryStats.Usage,
UsageP: float64(myRawStat.Stats.MemoryStats.Usage) / float64(myRawStat.Stats.MemoryStats.Limit),
}
Expand Down

0 comments on commit 90e7198

Please sign in to comment.