Skip to content

Commit

Permalink
Merge branch 'master' into feature/add_context_support
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou authored Jan 9, 2018
2 parents cd61c36 + d1fb05a commit a97abd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 0 additions & 7 deletions docker/docker_notlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ package docker

import (
"context"
"encoding/json"

"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/internal/common"
)
Expand Down Expand Up @@ -65,8 +63,3 @@ func CgroupMemDocker(containerid string) (*CgroupMemStat, error) {
func CgroupMemDockerWithContext(ctx context.Context, containerid string) (*CgroupMemStat, error) {
return CgroupMem(containerid, common.HostSys("fs/cgroup/memory/docker"))
}

func (m CgroupMemStat) String() string {
s, _ := json.Marshal(m)
return string(s)
}
8 changes: 8 additions & 0 deletions host/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package host

import (
"fmt"
"os"
"testing"
)

Expand All @@ -20,6 +21,10 @@ func TestHostInfo(t *testing.T) {
}

func TestUptime(t *testing.T) {
if os.Getenv("CIRCLECI") == "true" {
t.Skip("Skip CI")
}

v, err := Uptime()
if err != nil {
t.Errorf("error %v", err)
Expand All @@ -30,6 +35,9 @@ func TestUptime(t *testing.T) {
}

func TestBoot_time(t *testing.T) {
if os.Getenv("CIRCLECI") == "true" {
t.Skip("Skip CI")
}
v, err := BootTime()
if err != nil {
t.Errorf("error %v", err)
Expand Down
4 changes: 4 additions & 0 deletions process/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ func Test_Process_CpuPercentLoop(t *testing.T) {
}

func Test_Process_CreateTime(t *testing.T) {
if os.Getenv("CIRCLECI") == "true" {
t.Skip("Skip CI")
}

p := testGetProcess()

c, err := p.CreateTime()
Expand Down

0 comments on commit a97abd3

Please sign in to comment.