From 813d247bc70b9a449b9a2efe16360c167b41af2e Mon Sep 17 00:00:00 2001 From: Vishnu Kannan Date: Thu, 26 Jun 2014 20:49:02 +0000 Subject: [PATCH] Fixing some nits. Docker-DCO-1.1-Signed-off-by: Vishnu Kannan (github: vishh) --- api.go | 2 +- network/stats.go | 6 ++++-- nsinit/stats.go | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/api.go b/api.go index 4651c618..310f06e8 100644 --- a/api.go +++ b/api.go @@ -6,7 +6,7 @@ import ( ) // Returns all available stats for the given container. -func GetContainerStats(container *Config, state *State) (*ContainerStats, error) { +func GetStats(container *Config, state *State) (*ContainerStats, error) { var containerStats ContainerStats stats, err := fs.GetStats(container.Cgroups) if err != nil { diff --git a/network/stats.go b/network/stats.go index 1ae8482e..b69fa918 100644 --- a/network/stats.go +++ b/network/stats.go @@ -30,14 +30,16 @@ func GetStats(networkState *NetworkState) (NetworkStats, error) { return NetworkStats{}, err } - return NetworkStats{RxBytes: data["rx_bytes"], + return NetworkStats{ + RxBytes: data["rx_bytes"], RxPackets: data["rx_packets"], RxErrors: data["rx_errors"], RxDropped: data["rx_dropped"], TxBytes: data["tx_bytes"], TxPackets: data["tx_packets"], TxErrors: data["tx_errors"], - TxDropped: data["tx_dropped"]}, nil + TxDropped: data["tx_dropped"], + }, nil } // Reads all the statistics available under /sys/class/net//statistics as a map with file name as key and data as integers. diff --git a/nsinit/stats.go b/nsinit/stats.go index 5a90b599..eae98338 100644 --- a/nsinit/stats.go +++ b/nsinit/stats.go @@ -26,7 +26,7 @@ func statsAction(context *cli.Context) { log.Fatal(err) } - stats, err := getContainerStats(container, runtimeCkpt) + stats, err := getStats(container, runtimeCkpt) if err != nil { log.Fatalf("Failed to get stats - %v\n", err) } @@ -35,8 +35,8 @@ func statsAction(context *cli.Context) { } // returns the container stats in json format. -func getContainerStats(container *libcontainer.Config, state *libcontainer.State) (string, error) { - stats, err := libcontainer.GetContainerStats(container, state) +func getStats(container *libcontainer.Config, state *libcontainer.State) (string, error) { + stats, err := libcontainer.GetStats(container, state) if err != nil { return "", err }