multitenant: scan container command-lines as well as process

This commit is contained in:
Bryan Boreham
2020-05-19 10:09:28 +00:00
parent f83ad517d8
commit ad82fafde8

View File

@@ -139,13 +139,22 @@ func (e *BillingEmitter) reportInterval(r report.Report) time.Duration {
return r.Window
}
var inter string
for _, c := range r.Process.Nodes {
if cmd, ok := c.Latest.Lookup(report.Cmdline); ok {
for _, c := range r.Container.Nodes {
if cmd, ok := c.Latest.Lookup(report.DockerContainerCommand); ok {
if inter = intervalFromCommand(cmd); inter != "" {
break
}
}
}
if inter == "" { // not found in containers: look in processes
for _, c := range r.Process.Nodes {
if cmd, ok := c.Latest.Lookup(report.Cmdline); ok {
if inter = intervalFromCommand(cmd); inter != "" {
break
}
}
}
}
if inter == "" {
return 0
}