mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-14 05:19:21 +00:00
Merge pull request #400 from liubin/wip/add-pod-overhead
runtime: add pod overhead metrics
This commit is contained in:
@@ -68,6 +68,8 @@ type VCSandbox interface {
|
||||
ID() string
|
||||
SetAnnotations(annotations map[string]string) error
|
||||
|
||||
Stats() (SandboxStats, error)
|
||||
|
||||
Start() error
|
||||
Stop(force bool) error
|
||||
Release() error
|
||||
|
@@ -125,6 +125,9 @@ func (s *Sandbox) StatusContainer(contID string) (vc.ContainerStatus, error) {
|
||||
|
||||
// StatsContainer implements the VCSandbox function of the same name.
|
||||
func (s *Sandbox) StatsContainer(contID string) (vc.ContainerStats, error) {
|
||||
if s.StatsContainerFunc != nil {
|
||||
return s.StatsContainerFunc(contID)
|
||||
}
|
||||
return vc.ContainerStats{}, nil
|
||||
}
|
||||
|
||||
@@ -232,3 +235,11 @@ func (s *Sandbox) GetAgentMetrics() (string, error) {
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// Stats implements the VCSandbox function of the same name.
|
||||
func (s *Sandbox) Stats() (vc.SandboxStats, error) {
|
||||
if s.StatsFunc != nil {
|
||||
return s.StatsFunc()
|
||||
}
|
||||
return vc.SandboxStats{}, nil
|
||||
}
|
||||
|
@@ -66,6 +66,7 @@ type Sandbox struct {
|
||||
ListRoutesFunc func() ([]*vcTypes.Route, error)
|
||||
UpdateRuntimeMetricsFunc func() error
|
||||
GetAgentMetricsFunc func() (string, error)
|
||||
StatsFunc func() (vc.SandboxStats, error)
|
||||
}
|
||||
|
||||
// Container is a fake Container type used for testing
|
||||
|
Reference in New Issue
Block a user