mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-10-05 09:53:21 +08:00
Show cpu and memory stats of every node
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"io"
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
@@ -28,6 +29,12 @@ func init() {
|
||||
|
||||
}
|
||||
|
||||
func GetContainerStats(id string) (io.ReadCloser, error) {
|
||||
stats, err := c.ContainerStats(context.Background(), id, true)
|
||||
|
||||
return stats.Body, err
|
||||
}
|
||||
|
||||
func GetContainerInfo(id string) (types.ContainerJSON, error) {
|
||||
return c.ContainerInspect(context.Background(), id)
|
||||
}
|
||||
|
Reference in New Issue
Block a user