-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User specified parameters for container info. #79
Conversation
nit: can you squash your commits :) |
NumStats int `json:"num_stats,omitempty"` | ||
NumSamples int `json:"num_samples,omitempty"` | ||
|
||
CpuUsagePercentages []int `json:"cpu_usage_percentages,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both of these are percentiles
All comments addressed. PTAL. |
err := decoder.Decode(&query) | ||
if err != nil && err != io.EOF { | ||
fmt.Fprintf(w, "unable to decode the json value: ", err) | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just return fmt.Errorf() of what you Fprintf'd now
PTAL. |
decoder := json.NewDecoder(r.Body) | ||
err := decoder.Decode(expectedPostObjEmpty) | ||
if err != nil { | ||
t.Errorf("Recived invalid object: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: type in Received here and below
PTAL. |
@@ -280,6 +376,23 @@ func NewSample(prev, current *ContainerStats) (*ContainerStatsSample, error) { | |||
return sample, nil | |||
} | |||
|
|||
func NewSamplesFromStats(stats ...*ContainerStats) ([]*ContainerStatsSample, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used by test code. Move there?
@@ -162,7 +162,7 @@ func ServerContainersPage(m manager.Manager, w http.ResponseWriter, u *url.URL) | |||
containerName := u.Path[len(ContainersPage)-1:] | |||
|
|||
// Get the container. | |||
cont, err := m.GetContainerInfo(containerName) | |||
cont, err := m.GetContainerInfo(containerName, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UI today expects at max 60 data points so we should make a ContainerInfoRequest with that.
Ping @monnand? |
@vmarmol Sorry, There's a conference for interns yesterday and today. |
@vmarmol All comments addressed except the |
@@ -280,6 +376,25 @@ func NewSample(prev, current *ContainerStats) (*ContainerStatsSample, error) { | |||
return sample, nil | |||
} | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this commented out code and we can merge :)
Thanks @monnand! No rush, I think I'll just tag 0.1.2 without this.
@vmarmol Done. Thank you! |
Thanks @monnand! Merging when CI finishes. |
User specified parameters for container info.
In this PR, we allow api users to specify how many stats/samples they want to retrieve and also let them to specify which percentile of CPU/Memory usage they want to retrieve.