Skip to content

Commit

Permalink
Fixing some nits.
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
  • Loading branch information
vishh committed Jun 26, 2014
1 parent 3e5fe45 commit 813d247
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions network/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/<EthInterface>/statistics as a map with file name as key and data as integers.
Expand Down
6 changes: 3 additions & 3 deletions nsinit/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
}
Expand Down

0 comments on commit 813d247

Please sign in to comment.