Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2b42d71a
Commit
2b42d71a
authored
Apr 04, 2017
by
Manjunath A Kumatagi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cadvisor version to latest version
parent
e36cca4b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
396 additions
and
106 deletions
+396
-106
Godeps.json
Godeps/Godeps.json
+85
-80
LICENSES
Godeps/LICENSES
+0
-0
BUILD
vendor/BUILD
+3
-0
BUILD
vendor/github.com/google/cadvisor/container/docker/BUILD
+1
-0
docker.go
vendor/github.com/google/cadvisor/container/docker/docker.go
+27
-10
factory.go
...or/github.com/google/cadvisor/container/docker/factory.go
+38
-3
handler.go
...or/github.com/google/cadvisor/container/docker/handler.go
+44
-2
fs.go
vendor/github.com/google/cadvisor/fs/fs.go
+25
-0
docker.go
vendor/github.com/google/cadvisor/info/v1/docker.go
+1
-0
machine.go
vendor/github.com/google/cadvisor/info/v1/machine.go
+3
-0
machine.go
vendor/github.com/google/cadvisor/info/v2/machine.go
+4
-0
manager.go
vendor/github.com/google/cadvisor/manager/manager.go
+2
-0
docker.go
vendor/github.com/google/cadvisor/pages/docker.go
+1
-0
docker.go
vendor/github.com/google/cadvisor/utils/docker/docker.go
+15
-5
sysfs.go
vendor/github.com/google/cadvisor/utils/sysfs/sysfs.go
+2
-2
sysinfo.go
vendor/github.com/google/cadvisor/utils/sysinfo/sysinfo.go
+1
-4
BUILD
vendor/github.com/google/cadvisor/zfs/BUILD
+31
-0
watcher.go
vendor/github.com/google/cadvisor/zfs/watcher.go
+113
-0
No files found.
Godeps/Godeps.json
View file @
2b42d71a
...
...
@@ -1225,203 +1225,208 @@
},
{
"ImportPath"
:
"github.com/google/cadvisor/api"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/cache/memory"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/client/v2"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/collector"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/container"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/container/common"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/container/docker"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/container/libcontainer"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/container/raw"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/container/rkt"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/container/systemd"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/devicemapper"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/events"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/fs"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/healthz"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/http"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/http/mux"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/info/v1"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/info/v2"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/machine"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/manager"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher/raw"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/manager/watcher/rkt"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/metrics"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/pages"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/pages/static"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/storage"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/summary"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/cloudinfo"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/cpuload"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/cpuload/netlink"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/docker"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/oomparser"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/sysfs"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/sysinfo"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/utils/tail"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/validate"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"
17543becf9053e7e80806a57b05002a88c79ec8a
"
"Comment"
:
"v0.25.0
-14-g2ddeb5f
"
,
"Rev"
:
"
2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c
"
},
{
"ImportPath"
:
"github.com/google/cadvisor/version"
,
"Comment"
:
"v0.25.0"
,
"Rev"
:
"17543becf9053e7e80806a57b05002a88c79ec8a"
"Comment"
:
"v0.25.0-14-g2ddeb5f"
,
"Rev"
:
"2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c"
},
{
"ImportPath"
:
"github.com/google/cadvisor/zfs"
,
"Comment"
:
"v0.25.0-14-g2ddeb5f"
,
"Rev"
:
"2ddeb5f60e22d86c8d1eeb654dfb8bfadf93374c"
},
{
"ImportPath"
:
"github.com/google/certificate-transparency/go"
,
...
...
Godeps/LICENSES
View file @
2b42d71a
This diff is collapsed.
Click to expand it.
vendor/BUILD
View file @
2b42d71a
...
...
@@ -2,6 +2,8 @@ package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load("@io_bazel_rules_go//go:def.bzl")
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
...
...
@@ -213,6 +215,7 @@ filegroup(
"//vendor/github.com/google/cadvisor/utils:all-srcs",
"//vendor/github.com/google/cadvisor/validate:all-srcs",
"//vendor/github.com/google/cadvisor/version:all-srcs",
"//vendor/github.com/google/cadvisor/zfs:all-srcs",
"//vendor/github.com/google/certificate-transparency/go:all-srcs",
"//vendor/github.com/google/gofuzz:all-srcs",
"//vendor/github.com/gophercloud/gophercloud:all-srcs",
...
...
vendor/github.com/google/cadvisor/container/docker/BUILD
View file @
2b42d71a
...
...
@@ -31,6 +31,7 @@ go_library(
"//vendor/github.com/google/cadvisor/machine:go_default_library",
"//vendor/github.com/google/cadvisor/manager/watcher:go_default_library",
"//vendor/github.com/google/cadvisor/utils/docker:go_default_library",
"//vendor/github.com/google/cadvisor/zfs:go_default_library",
"//vendor/github.com/opencontainers/runc/libcontainer/cgroups:go_default_library",
"//vendor/github.com/opencontainers/runc/libcontainer/cgroups/fs:go_default_library",
"//vendor/github.com/opencontainers/runc/libcontainer/configs:go_default_library",
...
...
vendor/github.com/google/cadvisor/container/docker/docker.go
View file @
2b42d71a
...
...
@@ -17,6 +17,7 @@ package docker
import
(
"fmt"
"regexp"
"strconv"
"strings"
...
...
@@ -39,6 +40,7 @@ func Status() (v1.DockerStatus, error) {
out
:=
v1
.
DockerStatus
{}
out
.
Version
=
VersionString
()
out
.
APIVersion
=
APIVersionString
()
out
.
KernelVersion
=
machine
.
KernelVersion
()
out
.
OS
=
dockerInfo
.
OperatingSystem
out
.
Hostname
=
dockerInfo
.
Name
...
...
@@ -105,7 +107,7 @@ func ValidateInfo() (*dockertypes.Info, error) {
}
dockerInfo
.
ServerVersion
=
version
.
Version
}
version
,
err
:=
parse
DockerVersion
(
dockerInfo
.
ServerVersion
)
version
,
err
:=
parse
Version
(
dockerInfo
.
ServerVersion
,
version_re
,
3
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -129,7 +131,11 @@ func ValidateInfo() (*dockertypes.Info, error) {
}
func
Version
()
([]
int
,
error
)
{
return
parseDockerVersion
(
VersionString
())
return
parseVersion
(
VersionString
(),
version_re
,
3
)
}
func
APIVersion
()
([]
int
,
error
)
{
return
parseVersion
(
APIVersionString
(),
apiversion_re
,
2
)
}
func
VersionString
()
string
{
...
...
@@ -144,18 +150,29 @@ func VersionString() string {
return
docker_version
}
// TODO: switch to a semantic versioning library.
func
parseDockerVersion
(
full_version_string
string
)
([]
int
,
error
)
{
matches
:=
version_re
.
FindAllStringSubmatch
(
full_version_string
,
-
1
)
func
APIVersionString
()
string
{
docker_api_version
:=
"Unknown"
client
,
err
:=
Client
()
if
err
==
nil
{
version
,
err
:=
client
.
ServerVersion
(
context
.
Background
())
if
err
==
nil
{
docker_api_version
=
version
.
APIVersion
}
}
return
docker_api_version
}
func
parseVersion
(
version_string
string
,
regex
*
regexp
.
Regexp
,
length
int
)
([]
int
,
error
)
{
matches
:=
regex
.
FindAllStringSubmatch
(
version_string
,
-
1
)
if
len
(
matches
)
!=
1
{
return
nil
,
fmt
.
Errorf
(
"version string
\"
%v
\"
doesn't match expected regular expression:
\"
%v
\"
"
,
full_version_string
,
version_regexp_string
)
return
nil
,
fmt
.
Errorf
(
"version string
\"
%v
\"
doesn't match expected regular expression:
\"
%v
\"
"
,
version_string
,
regex
.
String
()
)
}
version_string_array
:=
matches
[
0
][
1
:
]
version_array
:=
make
([]
int
,
3
)
for
index
,
version_str
ing
:=
range
version_string_array
{
version
,
err
:=
strconv
.
Atoi
(
version_str
ing
)
version_array
:=
make
([]
int
,
length
)
for
index
,
version_str
:=
range
version_string_array
{
version
,
err
:=
strconv
.
Atoi
(
version_str
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"error while parsing
\"
%v
\"
in
\"
%v
\"
"
,
version_str
ing
,
full_
version_string
)
return
nil
,
fmt
.
Errorf
(
"error while parsing
\"
%v
\"
in
\"
%v
\"
"
,
version_str
,
version_string
)
}
version_array
[
index
]
=
version
}
...
...
vendor/github.com/google/cadvisor/container/docker/factory.go
View file @
2b42d71a
...
...
@@ -33,6 +33,7 @@ import (
"github.com/google/cadvisor/machine"
"github.com/google/cadvisor/manager/watcher"
dockerutil
"github.com/google/cadvisor/utils/docker"
"github.com/google/cadvisor/zfs"
docker
"github.com/docker/engine-api/client"
"github.com/golang/glog"
...
...
@@ -102,9 +103,13 @@ type dockerFactory struct {
dockerVersion
[]
int
dockerAPIVersion
[]
int
ignoreMetrics
container
.
MetricSet
thinPoolWatcher
*
devicemapper
.
ThinPoolWatcher
zfsWatcher
*
zfs
.
ZfsWatcher
}
func
(
self
*
dockerFactory
)
String
()
string
{
...
...
@@ -132,6 +137,7 @@ func (self *dockerFactory) NewContainerHandler(name string, inHostNamespace bool
self
.
dockerVersion
,
self
.
ignoreMetrics
,
self
.
thinPoolWatcher
,
self
.
zfsWatcher
,
)
return
}
...
...
@@ -181,8 +187,10 @@ func (self *dockerFactory) DebugInfo() map[string][]string {
}
var
(
version_regexp_string
=
`(\d+)\.(\d+)\.(\d+)`
version_re
=
regexp
.
MustCompile
(
version_regexp_string
)
version_regexp_string
=
`(\d+)\.(\d+)\.(\d+)`
version_re
=
regexp
.
MustCompile
(
version_regexp_string
)
apiversion_regexp_string
=
`(\d+)\.(\d+)`
apiversion_re
=
regexp
.
MustCompile
(
apiversion_regexp_string
)
)
func
startThinPoolWatcher
(
dockerInfo
*
dockertypes
.
Info
)
(
*
devicemapper
.
ThinPoolWatcher
,
error
)
{
...
...
@@ -218,6 +226,21 @@ func startThinPoolWatcher(dockerInfo *dockertypes.Info) (*devicemapper.ThinPoolW
return
thinPoolWatcher
,
nil
}
func
startZfsWatcher
(
dockerInfo
*
dockertypes
.
Info
)
(
*
zfs
.
ZfsWatcher
,
error
)
{
filesystem
,
err
:=
dockerutil
.
DockerZfsFilesystem
(
*
dockerInfo
)
if
err
!=
nil
{
return
nil
,
err
}
zfsWatcher
,
err
:=
zfs
.
NewZfsWatcher
(
filesystem
)
if
err
!=
nil
{
return
nil
,
err
}
go
zfsWatcher
.
Start
()
return
zfsWatcher
,
nil
}
func
ensureThinLsKernelVersion
(
kernelVersion
string
)
error
{
// kernel 4.4.0 has the proper bug fixes to allow thin_ls to work without corrupting the thin pool
minKernelVersion
:=
semver
.
MustParse
(
"4.4.0"
)
...
...
@@ -291,7 +314,9 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, ignoreMetrics c
}
// Version already validated above, assume no error here.
dockerVersion
,
_
:=
parseDockerVersion
(
dockerInfo
.
ServerVersion
)
dockerVersion
,
_
:=
parseVersion
(
dockerInfo
.
ServerVersion
,
version_re
,
3
)
dockerAPIVersion
,
_
:=
APIVersion
()
cgroupSubsystems
,
err
:=
libcontainer
.
GetCgroupSubsystems
()
if
err
!=
nil
{
...
...
@@ -306,17 +331,27 @@ func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, ignoreMetrics c
}
}
var
zfsWatcher
*
zfs
.
ZfsWatcher
if
storageDriver
(
dockerInfo
.
Driver
)
==
zfsStorageDriver
{
zfsWatcher
,
err
=
startZfsWatcher
(
dockerInfo
)
if
err
!=
nil
{
glog
.
Errorf
(
"zfs filesystem stats will not be reported: %v"
,
err
)
}
}
glog
.
Infof
(
"Registering Docker factory"
)
f
:=
&
dockerFactory
{
cgroupSubsystems
:
cgroupSubsystems
,
client
:
client
,
dockerVersion
:
dockerVersion
,
dockerAPIVersion
:
dockerAPIVersion
,
fsInfo
:
fsInfo
,
machineInfoFactory
:
factory
,
storageDriver
:
storageDriver
(
dockerInfo
.
Driver
),
storageDir
:
RootDir
(),
ignoreMetrics
:
ignoreMetrics
,
thinPoolWatcher
:
thinPoolWatcher
,
zfsWatcher
:
zfsWatcher
,
}
container
.
RegisterContainerHandlerFactory
(
f
,
[]
watcher
.
ContainerWatchSource
{
watcher
.
Raw
})
...
...
vendor/github.com/google/cadvisor/container/docker/handler.go
View file @
2b42d71a
...
...
@@ -29,6 +29,7 @@ import (
"github.com/google/cadvisor/fs"
info
"github.com/google/cadvisor/info/v1"
dockerutil
"github.com/google/cadvisor/utils/docker"
"github.com/google/cadvisor/zfs"
docker
"github.com/docker/engine-api/client"
dockercontainer
"github.com/docker/engine-api/types/container"
...
...
@@ -42,6 +43,7 @@ import (
const
(
// The read write layers exist here.
aufsRWLayer
=
"diff"
// Path to the directory where docker stores log files if the json logging driver is enabled.
pathToContainersDir
=
"containers"
)
...
...
@@ -72,6 +74,12 @@ type dockerContainerHandler struct {
// the devicemapper device id for the container
deviceID
string
// zfs Filesystem
zfsFilesystem
string
// zfsParent is the parent for docker zfs
zfsParent
string
// Time at which this container was created.
creationTime
time
.
Time
...
...
@@ -101,6 +109,9 @@ type dockerContainerHandler struct {
// thin pool watcher
thinPoolWatcher
*
devicemapper
.
ThinPoolWatcher
// zfs watcher
zfsWatcher
*
zfs
.
ZfsWatcher
}
var
_
container
.
ContainerHandler
=
&
dockerContainerHandler
{}
...
...
@@ -136,6 +147,7 @@ func newDockerContainerHandler(
dockerVersion
[]
int
,
ignoreMetrics
container
.
MetricSet
,
thinPoolWatcher
*
devicemapper
.
ThinPoolWatcher
,
zfsWatcher
*
zfs
.
ZfsWatcher
,
)
(
container
.
ContainerHandler
,
error
)
{
// Create the cgroup paths.
cgroupPaths
:=
make
(
map
[
string
]
string
,
len
(
cgroupSubsystems
.
MountPoints
))
...
...
@@ -172,12 +184,21 @@ func newDockerContainerHandler(
var
(
rootfsStorageDir
string
poolName
string
zfsFilesystem
string
zfsParent
string
)
switch
storageDriver
{
case
aufsStorageDriver
:
rootfsStorageDir
=
path
.
Join
(
storageDir
,
string
(
aufsStorageDriver
),
aufsRWLayer
,
rwLayerID
)
case
overlayStorageDriver
:
rootfsStorageDir
=
path
.
Join
(
storageDir
,
string
(
overlayStorageDriver
),
rwLayerID
)
case
zfsStorageDriver
:
status
,
err
:=
Status
()
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"unable to determine docker status: %v"
,
err
)
}
zfsParent
=
status
.
DriverStatus
[
dockerutil
.
DriverStatusParentDataset
]
zfsFilesystem
=
path
.
Join
(
zfsParent
,
rwLayerID
)
case
devicemapperStorageDriver
:
status
,
err
:=
Status
()
if
err
!=
nil
{
...
...
@@ -199,10 +220,13 @@ func newDockerContainerHandler(
fsInfo
:
fsInfo
,
rootFs
:
rootFs
,
poolName
:
poolName
,
zfsFilesystem
:
zfsFilesystem
,
rootfsStorageDir
:
rootfsStorageDir
,
envs
:
make
(
map
[
string
]
string
),
ignoreMetrics
:
ignoreMetrics
,
thinPoolWatcher
:
thinPoolWatcher
,
zfsWatcher
:
zfsWatcher
,
zfsParent
:
zfsParent
,
}
// We assume that if Inspect fails then the container is not known to docker.
...
...
@@ -245,7 +269,9 @@ func newDockerContainerHandler(
handler
.
fsHandler
=
&
dockerFsHandler
{
fsHandler
:
common
.
NewFsHandler
(
common
.
DefaultPeriod
,
rootfsStorageDir
,
otherStorageDir
,
fsInfo
),
thinPoolWatcher
:
thinPoolWatcher
,
zfsWatcher
:
zfsWatcher
,
deviceID
:
handler
.
deviceID
,
zfsFilesystem
:
zfsFilesystem
,
}
}
...
...
@@ -265,7 +291,7 @@ func newDockerContainerHandler(
}
// dockerFsHandler is a composite FsHandler implementation the incorporates
// the common fs handler
and a devicemapper ThinPoolWatcher.
// the common fs handler
, a devicemapper ThinPoolWatcher, and a zfsWatcher
type
dockerFsHandler
struct
{
fsHandler
common
.
FsHandler
...
...
@@ -273,6 +299,11 @@ type dockerFsHandler struct {
thinPoolWatcher
*
devicemapper
.
ThinPoolWatcher
// deviceID is the id of the container's fs device
deviceID
string
// zfsWatcher is the zfs filesystem watcher
zfsWatcher
*
zfs
.
ZfsWatcher
// zfsFilesystem is the docker zfs filesystem
zfsFilesystem
string
}
var
_
common
.
FsHandler
=
&
dockerFsHandler
{}
...
...
@@ -306,6 +337,15 @@ func (h *dockerFsHandler) Usage() common.FsUsage {
}
}
if
h
.
zfsWatcher
!=
nil
{
zfsUsage
,
err
:=
h
.
zfsWatcher
.
GetUsage
(
h
.
zfsFilesystem
)
if
err
!=
nil
{
glog
.
V
(
5
)
.
Infof
(
"unable to get fs usage from zfs for filesystem %s: %v"
,
h
.
zfsFilesystem
,
err
)
}
else
{
usage
.
BaseUsageBytes
=
zfsUsage
usage
.
TotalUsageBytes
+=
zfsUsage
}
}
return
usage
}
...
...
@@ -359,12 +399,14 @@ func (self *dockerContainerHandler) getFsStats(stats *info.ContainerStats) error
// Device has to be the pool name to correlate with the device name as
// set in the machine info filesystems.
device
=
self
.
poolName
case
aufsStorageDriver
,
overlayStorageDriver
,
zfsStorageDriver
:
case
aufsStorageDriver
,
overlayStorageDriver
:
deviceInfo
,
err
:=
self
.
fsInfo
.
GetDirFsDevice
(
self
.
rootfsStorageDir
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"unable to determine device info for dir: %v: %v"
,
self
.
rootfsStorageDir
,
err
)
}
device
=
deviceInfo
.
Device
case
zfsStorageDriver
:
device
=
self
.
zfsParent
default
:
return
nil
}
...
...
vendor/github.com/google/cadvisor/fs/fs.go
View file @
2b42d71a
...
...
@@ -149,6 +149,31 @@ func processMounts(mounts []*mount.Info, excludedMountpointPrefixes []string) ma
continue
}
// btrfs fix: following workaround fixes wrong btrfs Major and Minor Ids reported in /proc/self/mountinfo.
// instead of using values from /proc/self/mountinfo we use stat to get Ids from btrfs mount point
if
mount
.
Fstype
==
"btrfs"
&&
mount
.
Major
==
0
&&
strings
.
HasPrefix
(
mount
.
Source
,
"/dev/"
)
{
buf
:=
new
(
syscall
.
Stat_t
)
err
:=
syscall
.
Stat
(
mount
.
Source
,
buf
)
if
err
!=
nil
{
glog
.
Warningf
(
"stat failed on %s with error: %s"
,
mount
.
Source
,
err
)
}
else
{
glog
.
Infof
(
"btrfs mount %#v"
,
mount
)
if
buf
.
Mode
&
syscall
.
S_IFMT
==
syscall
.
S_IFBLK
{
err
:=
syscall
.
Stat
(
mount
.
Mountpoint
,
buf
)
if
err
!=
nil
{
glog
.
Warningf
(
"stat failed on %s with error: %s"
,
mount
.
Mountpoint
,
err
)
}
else
{
glog
.
Infof
(
"btrfs dev major:minor %d:%d
\n
"
,
int
(
major
(
buf
.
Dev
)),
int
(
minor
(
buf
.
Dev
)))
glog
.
Infof
(
"btrfs rdev major:minor %d:%d
\n
"
,
int
(
major
(
buf
.
Rdev
)),
int
(
minor
(
buf
.
Rdev
)))
mount
.
Major
=
int
(
major
(
buf
.
Dev
))
mount
.
Minor
=
int
(
minor
(
buf
.
Dev
))
}
}
}
}
partitions
[
mount
.
Source
]
=
partition
{
fsType
:
mount
.
Fstype
,
mountpoint
:
mount
.
Mountpoint
,
...
...
vendor/github.com/google/cadvisor/info/v1/docker.go
View file @
2b42d71a
...
...
@@ -17,6 +17,7 @@ package v1
type
DockerStatus
struct
{
Version
string
`json:"version"`
APIVersion
string
`json:"api_version"`
KernelVersion
string
`json:"kernel_version"`
OS
string
`json:"os"`
Hostname
string
`json:"hostname"`
...
...
vendor/github.com/google/cadvisor/info/v1/machine.go
View file @
2b42d71a
...
...
@@ -196,6 +196,9 @@ type VersionInfo struct {
// Docker version.
DockerVersion
string
`json:"docker_version"`
// Docker API Version
DockerAPIVersion
string
`json:"docker_api_version"`
// cAdvisor version.
CadvisorVersion
string
`json:"cadvisor_version"`
// cAdvisor git revision.
...
...
vendor/github.com/google/cadvisor/info/v2/machine.go
View file @
2b42d71a
...
...
@@ -31,6 +31,9 @@ type Attributes struct {
// Docker version.
DockerVersion
string
`json:"docker_version"`
// Docker API version.
DockerAPIVersion
string
`json:"docker_api_version"`
// cAdvisor version.
CadvisorVersion
string
`json:"cadvisor_version"`
...
...
@@ -74,6 +77,7 @@ func GetAttributes(mi *v1.MachineInfo, vi *v1.VersionInfo) Attributes {
KernelVersion
:
vi
.
KernelVersion
,
ContainerOsVersion
:
vi
.
ContainerOsVersion
,
DockerVersion
:
vi
.
DockerVersion
,
DockerAPIVersion
:
vi
.
DockerAPIVersion
,
CadvisorVersion
:
vi
.
CadvisorVersion
,
NumCores
:
mi
.
NumCores
,
CpuFrequency
:
mi
.
CpuFrequency
,
...
...
vendor/github.com/google/cadvisor/manager/manager.go
View file @
2b42d71a
...
...
@@ -1255,11 +1255,13 @@ func getVersionInfo() (*info.VersionInfo, error) {
kernel_version
:=
machine
.
KernelVersion
()
container_os
:=
machine
.
ContainerOsVersion
()
docker_version
:=
docker
.
VersionString
()
docker_api_version
:=
docker
.
APIVersionString
()
return
&
info
.
VersionInfo
{
KernelVersion
:
kernel_version
,
ContainerOsVersion
:
container_os
,
DockerVersion
:
docker_version
,
DockerAPIVersion
:
docker_api_version
,
CadvisorVersion
:
version
.
Info
[
"version"
],
CadvisorRevision
:
version
.
Info
[
"revision"
],
},
nil
...
...
vendor/github.com/google/cadvisor/pages/docker.go
View file @
2b42d71a
...
...
@@ -40,6 +40,7 @@ func toStatusKV(status info.DockerStatus) ([]keyVal, []keyVal) {
}
return
[]
keyVal
{
{
Key
:
"Docker Version"
,
Value
:
status
.
Version
},
{
Key
:
"Docker API Version"
,
Value
:
status
.
APIVersion
},
{
Key
:
"Kernel Version"
,
Value
:
status
.
KernelVersion
},
{
Key
:
"OS Version"
,
Value
:
status
.
OS
},
{
Key
:
"Host Name"
,
Value
:
status
.
Hostname
},
...
...
vendor/github.com/google/cadvisor/utils/docker/docker.go
View file @
2b42d71a
...
...
@@ -23,11 +23,12 @@ import (
)
const
(
DockerInfoDriver
=
"Driver"
DockerInfoDriverStatus
=
"DriverStatus"
DriverStatusPoolName
=
"Pool Name"
DriverStatusDataLoopFile
=
"Data loop file"
DriverStatusMetadataFile
=
"Metadata file"
DockerInfoDriver
=
"Driver"
DockerInfoDriverStatus
=
"DriverStatus"
DriverStatusPoolName
=
"Pool Name"
DriverStatusDataLoopFile
=
"Data loop file"
DriverStatusMetadataFile
=
"Metadata file"
DriverStatusParentDataset
=
"Parent Dataset"
)
func
DriverStatusValue
(
status
[][
2
]
string
,
target
string
)
string
{
...
...
@@ -68,3 +69,12 @@ func DockerMetadataDevice(info dockertypes.Info) (string, error) {
return
metadataDevice
,
nil
}
func
DockerZfsFilesystem
(
info
dockertypes
.
Info
)
(
string
,
error
)
{
filesystem
:=
DriverStatusValue
(
info
.
DriverStatus
,
DriverStatusParentDataset
)
if
len
(
filesystem
)
==
0
{
return
""
,
fmt
.
Errorf
(
"Could not get zfs filesystem"
)
}
return
filesystem
,
nil
}
vendor/github.com/google/cadvisor/utils/sysfs/sysfs.go
View file @
2b42d71a
...
...
@@ -70,8 +70,8 @@ type SysFs interface {
type
realSysFs
struct
{}
func
NewRealSysFs
()
(
SysFs
,
error
)
{
return
&
realSysFs
{}
,
nil
func
NewRealSysFs
()
SysFs
{
return
&
realSysFs
{}
}
func
(
self
*
realSysFs
)
GetBlockDevices
()
([]
os
.
FileInfo
,
error
)
{
...
...
vendor/github.com/google/cadvisor/utils/sysinfo/sysinfo.go
View file @
2b42d71a
...
...
@@ -155,10 +155,7 @@ func GetCacheInfo(sysFs sysfs.SysFs, id int) ([]sysfs.CacheInfo, error) {
func
GetNetworkStats
(
name
string
)
(
info
.
InterfaceStats
,
error
)
{
// TODO(rjnagal): Take syfs as an argument.
sysFs
,
err
:=
sysfs
.
NewRealSysFs
()
if
err
!=
nil
{
return
info
.
InterfaceStats
{},
err
}
sysFs
:=
sysfs
.
NewRealSysFs
()
return
getNetworkStats
(
name
,
sysFs
)
}
...
...
vendor/github.com/google/cadvisor/zfs/BUILD
0 → 100644
View file @
2b42d71a
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["watcher.go"],
tags = ["automanaged"],
deps = [
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/github.com/mistifyio/go-zfs:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
vendor/github.com/google/cadvisor/zfs/watcher.go
0 → 100644
View file @
2b42d71a
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package
zfs
import
(
"fmt"
"sync"
"time"
"github.com/golang/glog"
zfs
"github.com/mistifyio/go-zfs"
)
// zfsWatcher maintains a cache of filesystem -> usage stats for a
// zfs filesystem
type
ZfsWatcher
struct
{
filesystem
string
lock
*
sync
.
RWMutex
cache
map
[
string
]
uint64
period
time
.
Duration
stopChan
chan
struct
{}
}
// NewThinPoolWatcher returns a new ThinPoolWatcher for the given devicemapper
// thin pool name and metadata device or an error.
func
NewZfsWatcher
(
filesystem
string
)
(
*
ZfsWatcher
,
error
)
{
return
&
ZfsWatcher
{
filesystem
:
filesystem
,
lock
:
&
sync
.
RWMutex
{},
cache
:
make
(
map
[
string
]
uint64
),
period
:
15
*
time
.
Second
,
stopChan
:
make
(
chan
struct
{}),
},
nil
}
// Start starts the ZfsWatcher.
func
(
w
*
ZfsWatcher
)
Start
()
{
err
:=
w
.
Refresh
()
if
err
!=
nil
{
glog
.
Errorf
(
"encountered error refreshing zfs watcher: %v"
,
err
)
}
for
{
select
{
case
<-
w
.
stopChan
:
return
case
<-
time
.
After
(
w
.
period
)
:
start
:=
time
.
Now
()
err
=
w
.
Refresh
()
if
err
!=
nil
{
glog
.
Errorf
(
"encountered error refreshing zfs watcher: %v"
,
err
)
}
// print latency for refresh
duration
:=
time
.
Since
(
start
)
glog
.
V
(
5
)
.
Infof
(
"zfs(%d) took %s"
,
start
.
Unix
(),
duration
)
}
}
}
// Stop stops the ZfsWatcher.
func
(
w
*
ZfsWatcher
)
Stop
()
{
close
(
w
.
stopChan
)
}
// GetUsage gets the cached usage value of the given filesystem.
func
(
w
*
ZfsWatcher
)
GetUsage
(
filesystem
string
)
(
uint64
,
error
)
{
w
.
lock
.
RLock
()
defer
w
.
lock
.
RUnlock
()
v
,
ok
:=
w
.
cache
[
filesystem
]
if
!
ok
{
return
0
,
fmt
.
Errorf
(
"no cached value for usage of filesystem %v"
,
filesystem
)
}
return
v
,
nil
}
// Refresh performs a zfs get
func
(
w
*
ZfsWatcher
)
Refresh
()
error
{
w
.
lock
.
Lock
()
defer
w
.
lock
.
Unlock
()
newCache
:=
make
(
map
[
string
]
uint64
)
parent
,
err
:=
zfs
.
GetDataset
(
w
.
filesystem
)
if
err
!=
nil
{
glog
.
Errorf
(
"encountered error getting zfs filesystem: %s: %v"
,
w
.
filesystem
,
err
)
return
err
}
children
,
err
:=
parent
.
Children
(
0
)
if
err
!=
nil
{
glog
.
Errorf
(
"encountered error getting children of zfs filesystem: %s: %v"
,
w
.
filesystem
,
err
)
return
err
}
for
_
,
ds
:=
range
children
{
newCache
[
ds
.
Name
]
=
ds
.
Used
}
w
.
cache
=
newCache
return
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment