mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-25 00:06:46 +00:00
multitenant: scan container command-lines as well as process
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user