From cc39f9996b15b97703bd85b0a6f579243ac58fd2 Mon Sep 17 00:00:00 2001 From: Nan Monnand Deng Date: Fri, 20 Jun 2014 17:22:03 -0400 Subject: [PATCH] name, docs --- advice/inference/detector.go | 13 +++++++++++-- info/advice.go | 10 +++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/advice/inference/detector.go b/advice/inference/detector.go index e4b9a08a..f6f9b676 100644 --- a/advice/inference/detector.go +++ b/advice/inference/detector.go @@ -16,8 +16,17 @@ package inference import "github.com/google/cadvisor/info" -type AntagonismDetector interface { +// InterferenceDectector detects if there's a container which +// interference with a set of container. The detector monitors +// a set of container and find the victims and antagnist. +type InterferenceDetector interface { + // Monitor the behavior of the container. AddContainer(ref info.ContainerReference) - Detect() ([]*info.Antagonism, error) + + // Returns a list of Interference. The upper layer may take action + // based on the interference. + Detect() ([]*info.Interference, error) + + // The name of the detector. Name() string } diff --git a/info/advice.go b/info/advice.go index d984ed2b..d2f527f6 100644 --- a/info/advice.go +++ b/info/advice.go @@ -17,7 +17,7 @@ package info // This struct describes one type of relationship between containers: One // container, antagonist, interferes the performance of other // containers, victims. -type Antagonism struct { +type Interference struct { // The absolute path of the atagnoism container name. This field should // not be empty. Antagonist string `json:"antagonist"` @@ -27,12 +27,8 @@ type Antagonism struct { // The detector name which detects this agtagonism. This field should // not be empty. - Dectory string `json:"detector"` + Detector string `json:"detector"` - // Human readable string + // Human readable description of the interference Description string `json:"description,omitempty"` } - -type Interference struct { - Antagonisms []*Antagonism `json:"antagonisms,omitempty"` -}