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
d0887aec
Commit
d0887aec
authored
Sep 01, 2015
by
Jimmi Dyson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cadvisor bump to 0.16.0.2
parent
a7e47cad
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
569 additions
and
406 deletions
+569
-406
Godeps.json
Godeps/Godeps.json
+36
-36
versions.go
..._workspace/src/github.com/google/cadvisor/api/versions.go
+64
-1
versions_test.go
...space/src/github.com/google/cadvisor/api/versions_test.go
+169
-0
factory.go
...rc/github.com/google/cadvisor/container/docker/factory.go
+2
-1
handler.go
...rc/github.com/google/cadvisor/container/docker/handler.go
+43
-48
factory.go
...space/src/github.com/google/cadvisor/container/factory.go
+3
-3
factory_test.go
.../src/github.com/google/cadvisor/container/factory_test.go
+7
-7
helpers.go
...hub.com/google/cadvisor/container/libcontainer/helpers.go
+81
-9
mock.go
...orkspace/src/github.com/google/cadvisor/container/mock.go
+1
-1
factory.go
...e/src/github.com/google/cadvisor/container/raw/factory.go
+6
-2
handler.go
...e/src/github.com/google/cadvisor/container/raw/handler.go
+5
-10
container.go
...space/src/github.com/google/cadvisor/info/v1/container.go
+3
-0
container.go
...space/src/github.com/google/cadvisor/info/v2/container.go
+32
-2
manager.go
...rkspace/src/github.com/google/cadvisor/manager/manager.go
+2
-1
prometheus.go
...pace/src/github.com/google/cadvisor/metrics/prometheus.go
+99
-34
prometheus_test.go
...src/github.com/google/cadvisor/metrics/prometheus_test.go
+16
-0
prometheus_metrics
...b.com/google/cadvisor/metrics/testdata/prometheus_metrics
+0
-0
cpuinfo
...github.com/google/cadvisor/utils/machine/testdata/cpuinfo
+0
-251
No files found.
Godeps/Godeps.json
View file @
d0887aec
...
@@ -261,93 +261,93 @@
...
@@ -261,93 +261,93 @@
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/api"
,
"ImportPath"
:
"github.com/google/cadvisor/api"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/cache/memory"
,
"ImportPath"
:
"github.com/google/cadvisor/cache/memory"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/collector"
,
"ImportPath"
:
"github.com/google/cadvisor/collector"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/container"
,
"ImportPath"
:
"github.com/google/cadvisor/container"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/events"
,
"ImportPath"
:
"github.com/google/cadvisor/events"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/fs"
,
"ImportPath"
:
"github.com/google/cadvisor/fs"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/healthz"
,
"ImportPath"
:
"github.com/google/cadvisor/healthz"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/http"
,
"ImportPath"
:
"github.com/google/cadvisor/http"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/info/v1"
,
"ImportPath"
:
"github.com/google/cadvisor/info/v1"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/info/v2"
,
"ImportPath"
:
"github.com/google/cadvisor/info/v2"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/manager"
,
"ImportPath"
:
"github.com/google/cadvisor/manager"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/metrics"
,
"ImportPath"
:
"github.com/google/cadvisor/metrics"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/pages"
,
"ImportPath"
:
"github.com/google/cadvisor/pages"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/storage"
,
"ImportPath"
:
"github.com/google/cadvisor/storage"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/summary"
,
"ImportPath"
:
"github.com/google/cadvisor/summary"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/utils"
,
"ImportPath"
:
"github.com/google/cadvisor/utils"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/validate"
,
"ImportPath"
:
"github.com/google/cadvisor/validate"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/cadvisor/version"
,
"ImportPath"
:
"github.com/google/cadvisor/version"
,
"Comment"
:
"0.16.0
-81-g27fb6d5
"
,
"Comment"
:
"0.16.0
.2
"
,
"Rev"
:
"
27fb6d593c6bffe274718119659815771e79e198
"
"Rev"
:
"
cefada41b87c35294533638733c563a349b95f05
"
},
},
{
{
"ImportPath"
:
"github.com/google/gofuzz"
,
"ImportPath"
:
"github.com/google/gofuzz"
,
...
...
Godeps/_workspace/src/github.com/google/cadvisor/api/versions.go
View file @
d0887aec
...
@@ -19,6 +19,7 @@ import (
...
@@ -19,6 +19,7 @@ import (
"net/http"
"net/http"
"path"
"path"
"strconv"
"strconv"
"time"
"github.com/golang/glog"
"github.com/golang/glog"
info
"github.com/google/cadvisor/info/v1"
info
"github.com/google/cadvisor/info/v1"
...
@@ -449,8 +450,63 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
...
@@ -449,8 +450,63 @@ func (self *version2_0) HandleRequest(requestType string, request []string, m ma
}
}
}
}
func
instCpuStats
(
last
,
cur
*
info
.
ContainerStats
)
(
*
v2
.
CpuInstStats
,
error
)
{
if
last
==
nil
{
return
nil
,
nil
}
if
!
cur
.
Timestamp
.
After
(
last
.
Timestamp
)
{
return
nil
,
fmt
.
Errorf
(
"container stats move backwards in time"
)
}
if
len
(
last
.
Cpu
.
Usage
.
PerCpu
)
!=
len
(
cur
.
Cpu
.
Usage
.
PerCpu
)
{
return
nil
,
fmt
.
Errorf
(
"different number of cpus"
)
}
timeDelta
:=
cur
.
Timestamp
.
Sub
(
last
.
Timestamp
)
if
timeDelta
<=
100
*
time
.
Millisecond
{
return
nil
,
fmt
.
Errorf
(
"time delta unexpectedly small"
)
}
// Nanoseconds to gain precision and avoid having zero seconds if the
// difference between the timestamps is just under a second
timeDeltaNs
:=
uint64
(
timeDelta
.
Nanoseconds
())
convertToRate
:=
func
(
lastValue
,
curValue
uint64
)
(
uint64
,
error
)
{
if
curValue
<
lastValue
{
return
0
,
fmt
.
Errorf
(
"cumulative stats decrease"
)
}
valueDelta
:=
curValue
-
lastValue
return
(
valueDelta
*
1e9
)
/
timeDeltaNs
,
nil
}
total
,
err
:=
convertToRate
(
last
.
Cpu
.
Usage
.
Total
,
cur
.
Cpu
.
Usage
.
Total
)
if
err
!=
nil
{
return
nil
,
err
}
percpu
:=
make
([]
uint64
,
len
(
last
.
Cpu
.
Usage
.
PerCpu
))
for
i
:=
range
percpu
{
var
err
error
percpu
[
i
],
err
=
convertToRate
(
last
.
Cpu
.
Usage
.
PerCpu
[
i
],
cur
.
Cpu
.
Usage
.
PerCpu
[
i
])
if
err
!=
nil
{
return
nil
,
err
}
}
user
,
err
:=
convertToRate
(
last
.
Cpu
.
Usage
.
User
,
cur
.
Cpu
.
Usage
.
User
)
if
err
!=
nil
{
return
nil
,
err
}
system
,
err
:=
convertToRate
(
last
.
Cpu
.
Usage
.
System
,
cur
.
Cpu
.
Usage
.
System
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
v2
.
CpuInstStats
{
Usage
:
v2
.
CpuInstUsage
{
Total
:
total
,
PerCpu
:
percpu
,
User
:
user
,
System
:
system
,
},
},
nil
}
func
convertStats
(
cont
*
info
.
ContainerInfo
)
[]
v2
.
ContainerStats
{
func
convertStats
(
cont
*
info
.
ContainerInfo
)
[]
v2
.
ContainerStats
{
stats
:=
[]
v2
.
ContainerStats
{}
stats
:=
make
([]
v2
.
ContainerStats
,
0
,
len
(
cont
.
Stats
))
var
last
*
info
.
ContainerStats
for
_
,
val
:=
range
cont
.
Stats
{
for
_
,
val
:=
range
cont
.
Stats
{
stat
:=
v2
.
ContainerStats
{
stat
:=
v2
.
ContainerStats
{
Timestamp
:
val
.
Timestamp
,
Timestamp
:
val
.
Timestamp
,
...
@@ -463,6 +519,13 @@ func convertStats(cont *info.ContainerInfo) []v2.ContainerStats {
...
@@ -463,6 +519,13 @@ func convertStats(cont *info.ContainerInfo) []v2.ContainerStats {
}
}
if
stat
.
HasCpu
{
if
stat
.
HasCpu
{
stat
.
Cpu
=
val
.
Cpu
stat
.
Cpu
=
val
.
Cpu
cpuInst
,
err
:=
instCpuStats
(
last
,
val
)
if
err
!=
nil
{
glog
.
Warningf
(
"Could not get instant cpu stats: %v"
,
err
)
}
else
{
stat
.
CpuInst
=
cpuInst
}
last
=
val
}
}
if
stat
.
HasMemory
{
if
stat
.
HasMemory
{
stat
.
Memory
=
val
.
Memory
stat
.
Memory
=
val
.
Memory
...
...
Godeps/_workspace/src/github.com/google/cadvisor/api/versions_test.go
View file @
d0887aec
...
@@ -19,9 +19,11 @@ import (
...
@@ -19,9 +19,11 @@ import (
"net/http"
"net/http"
"reflect"
"reflect"
"testing"
"testing"
"time"
"github.com/google/cadvisor/events"
"github.com/google/cadvisor/events"
info
"github.com/google/cadvisor/info/v1"
info
"github.com/google/cadvisor/info/v1"
"github.com/google/cadvisor/info/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
)
)
...
@@ -78,3 +80,170 @@ func TestGetEventRequestDoubleArgument(t *testing.T) {
...
@@ -78,3 +80,170 @@ func TestGetEventRequestDoubleArgument(t *testing.T) {
assert
.
True
(
t
,
stream
)
assert
.
True
(
t
,
stream
)
assert
.
Nil
(
t
,
err
)
assert
.
Nil
(
t
,
err
)
}
}
func
TestInstCpuStats
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
last
*
info
.
ContainerStats
cur
*
info
.
ContainerStats
want
*
v2
.
CpuInstStats
}{
// Last is missing
{
nil
,
&
info
.
ContainerStats
{},
nil
,
},
// Goes back in time
{
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
)
.
Add
(
time
.
Second
),
},
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
},
nil
,
},
// Zero time delta
{
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
},
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
},
nil
,
},
// Unexpectedly small time delta
{
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
},
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
)
.
Add
(
30
*
time
.
Millisecond
),
},
nil
,
},
// Different number of cpus
{
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
PerCpu
:
[]
uint64
{
100
,
200
},
},
},
},
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
)
.
Add
(
time
.
Second
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
PerCpu
:
[]
uint64
{
100
,
200
,
300
},
},
},
},
nil
,
},
// Stat numbers decrease
{
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
Total
:
300
,
PerCpu
:
[]
uint64
{
100
,
200
},
User
:
250
,
System
:
50
,
},
},
},
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
)
.
Add
(
time
.
Second
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
Total
:
200
,
PerCpu
:
[]
uint64
{
100
,
100
},
User
:
150
,
System
:
50
,
},
},
},
nil
,
},
// One second elapsed
{
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
Total
:
300
,
PerCpu
:
[]
uint64
{
100
,
200
},
User
:
250
,
System
:
50
,
},
},
},
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
)
.
Add
(
time
.
Second
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
Total
:
500
,
PerCpu
:
[]
uint64
{
200
,
300
},
User
:
400
,
System
:
100
,
},
},
},
&
v2
.
CpuInstStats
{
Usage
:
v2
.
CpuInstUsage
{
Total
:
200
,
PerCpu
:
[]
uint64
{
100
,
100
},
User
:
150
,
System
:
50
,
},
},
},
// Two seconds elapsed
{
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
Total
:
300
,
PerCpu
:
[]
uint64
{
100
,
200
},
User
:
250
,
System
:
50
,
},
},
},
&
info
.
ContainerStats
{
Timestamp
:
time
.
Unix
(
100
,
0
)
.
Add
(
2
*
time
.
Second
),
Cpu
:
info
.
CpuStats
{
Usage
:
info
.
CpuUsage
{
Total
:
500
,
PerCpu
:
[]
uint64
{
200
,
300
},
User
:
400
,
System
:
100
,
},
},
},
&
v2
.
CpuInstStats
{
Usage
:
v2
.
CpuInstUsage
{
Total
:
100
,
PerCpu
:
[]
uint64
{
50
,
50
},
User
:
75
,
System
:
25
,
},
},
},
}
for
_
,
c
:=
range
tests
{
got
,
err
:=
instCpuStats
(
c
.
last
,
c
.
cur
)
if
err
!=
nil
{
if
c
.
want
==
nil
{
continue
}
t
.
Errorf
(
"Unexpected error: %v"
,
err
)
}
assert
.
Equal
(
t
,
c
.
want
,
got
)
}
}
Godeps/_workspace/src/github.com/google/cadvisor/container/docker/factory.go
View file @
d0887aec
...
@@ -96,7 +96,7 @@ func (self *dockerFactory) String() string {
...
@@ -96,7 +96,7 @@ func (self *dockerFactory) String() string {
return
DockerNamespace
return
DockerNamespace
}
}
func
(
self
*
dockerFactory
)
NewContainerHandler
(
name
string
)
(
handler
container
.
ContainerHandler
,
err
error
)
{
func
(
self
*
dockerFactory
)
NewContainerHandler
(
name
string
,
inHostNamespace
bool
)
(
handler
container
.
ContainerHandler
,
err
error
)
{
client
,
err
:=
docker
.
NewClient
(
*
ArgDockerEndpoint
)
client
,
err
:=
docker
.
NewClient
(
*
ArgDockerEndpoint
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
...
@@ -108,6 +108,7 @@ func (self *dockerFactory) NewContainerHandler(name string) (handler container.C
...
@@ -108,6 +108,7 @@ func (self *dockerFactory) NewContainerHandler(name string) (handler container.C
self
.
fsInfo
,
self
.
fsInfo
,
self
.
usesAufsDriver
,
self
.
usesAufsDriver
,
&
self
.
cgroupSubsystems
,
&
self
.
cgroupSubsystems
,
inHostNamespace
,
)
)
return
return
}
}
...
...
Godeps/_workspace/src/github.com/google/cadvisor/container/docker/handler.go
View file @
d0887aec
...
@@ -71,6 +71,18 @@ type dockerContainerHandler struct {
...
@@ -71,6 +71,18 @@ type dockerContainerHandler struct {
// Metadata labels associated with the container.
// Metadata labels associated with the container.
labels
map
[
string
]
string
labels
map
[
string
]
string
// The container PID used to switch namespaces as required
pid
int
// Image name used for this container.
image
string
// The host root FS to read
rootFs
string
// The network mode of the container
networkMode
string
}
}
func
newDockerContainerHandler
(
func
newDockerContainerHandler
(
...
@@ -80,6 +92,7 @@ func newDockerContainerHandler(
...
@@ -80,6 +92,7 @@ func newDockerContainerHandler(
fsInfo
fs
.
FsInfo
,
fsInfo
fs
.
FsInfo
,
usesAufsDriver
bool
,
usesAufsDriver
bool
,
cgroupSubsystems
*
containerLibcontainer
.
CgroupSubsystems
,
cgroupSubsystems
*
containerLibcontainer
.
CgroupSubsystems
,
inHostNamespace
bool
,
)
(
container
.
ContainerHandler
,
error
)
{
)
(
container
.
ContainerHandler
,
error
)
{
// Create the cgroup paths.
// Create the cgroup paths.
cgroupPaths
:=
make
(
map
[
string
]
string
,
len
(
cgroupSubsystems
.
MountPoints
))
cgroupPaths
:=
make
(
map
[
string
]
string
,
len
(
cgroupSubsystems
.
MountPoints
))
...
@@ -95,6 +108,11 @@ func newDockerContainerHandler(
...
@@ -95,6 +108,11 @@ func newDockerContainerHandler(
Paths
:
cgroupPaths
,
Paths
:
cgroupPaths
,
}
}
rootFs
:=
"/"
if
!
inHostNamespace
{
rootFs
=
"/rootfs"
}
id
:=
ContainerNameToDockerId
(
name
)
id
:=
ContainerNameToDockerId
(
name
)
handler
:=
&
dockerContainerHandler
{
handler
:=
&
dockerContainerHandler
{
id
:
id
,
id
:
id
,
...
@@ -105,6 +123,7 @@ func newDockerContainerHandler(
...
@@ -105,6 +123,7 @@ func newDockerContainerHandler(
cgroupManager
:
cgroupManager
,
cgroupManager
:
cgroupManager
,
usesAufsDriver
:
usesAufsDriver
,
usesAufsDriver
:
usesAufsDriver
,
fsInfo
:
fsInfo
,
fsInfo
:
fsInfo
,
rootFs
:
rootFs
,
}
}
handler
.
storageDirs
=
append
(
handler
.
storageDirs
,
path
.
Join
(
*
dockerRootDir
,
pathToAufsDir
,
id
))
handler
.
storageDirs
=
append
(
handler
.
storageDirs
,
path
.
Join
(
*
dockerRootDir
,
pathToAufsDir
,
id
))
...
@@ -114,11 +133,14 @@ func newDockerContainerHandler(
...
@@ -114,11 +133,14 @@ func newDockerContainerHandler(
return
nil
,
fmt
.
Errorf
(
"failed to inspect container %q: %v"
,
id
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to inspect container %q: %v"
,
id
,
err
)
}
}
handler
.
creationTime
=
ctnr
.
Created
handler
.
creationTime
=
ctnr
.
Created
handler
.
pid
=
ctnr
.
State
.
Pid
// Add the name and bare ID as aliases of the container.
// Add the name and bare ID as aliases of the container.
handler
.
aliases
=
append
(
handler
.
aliases
,
strings
.
TrimPrefix
(
ctnr
.
Name
,
"/"
))
handler
.
aliases
=
append
(
handler
.
aliases
,
strings
.
TrimPrefix
(
ctnr
.
Name
,
"/"
))
handler
.
aliases
=
append
(
handler
.
aliases
,
id
)
handler
.
aliases
=
append
(
handler
.
aliases
,
id
)
handler
.
labels
=
ctnr
.
Config
.
Labels
handler
.
labels
=
ctnr
.
Config
.
Labels
handler
.
image
=
ctnr
.
Config
.
Image
handler
.
networkMode
=
ctnr
.
HostConfig
.
NetworkMode
return
handler
,
nil
return
handler
,
nil
}
}
...
@@ -167,21 +189,23 @@ func libcontainerConfigToContainerSpec(config *libcontainerConfigs.Config, mi *i
...
@@ -167,21 +189,23 @@ func libcontainerConfigToContainerSpec(config *libcontainerConfigs.Config, mi *i
}
}
spec
.
Cpu
.
Mask
=
utils
.
FixCpuMask
(
config
.
Cgroups
.
CpusetCpus
,
mi
.
NumCores
)
spec
.
Cpu
.
Mask
=
utils
.
FixCpuMask
(
config
.
Cgroups
.
CpusetCpus
,
mi
.
NumCores
)
// Docker reports a loop device for containers with --net=host. Ignore
// those too.
networkCount
:=
0
for
_
,
n
:=
range
config
.
Networks
{
if
n
.
Type
!=
"loopback"
{
networkCount
+=
1
}
}
spec
.
HasNetwork
=
networkCount
>
0
spec
.
HasDiskIo
=
true
spec
.
HasDiskIo
=
true
return
spec
return
spec
}
}
var
(
hasNetworkModes
=
map
[
string
]
bool
{
"host"
:
true
,
"bridge"
:
true
,
"default"
:
true
,
}
)
func
hasNet
(
networkMode
string
)
bool
{
return
hasNetworkModes
[
networkMode
]
}
func
(
self
*
dockerContainerHandler
)
GetSpec
()
(
info
.
ContainerSpec
,
error
)
{
func
(
self
*
dockerContainerHandler
)
GetSpec
()
(
info
.
ContainerSpec
,
error
)
{
mi
,
err
:=
self
.
machineInfoFactory
.
GetMachineInfo
()
mi
,
err
:=
self
.
machineInfoFactory
.
GetMachineInfo
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -198,6 +222,8 @@ func (self *dockerContainerHandler) GetSpec() (info.ContainerSpec, error) {
...
@@ -198,6 +222,8 @@ func (self *dockerContainerHandler) GetSpec() (info.ContainerSpec, error) {
spec
.
HasFilesystem
=
true
spec
.
HasFilesystem
=
true
}
}
spec
.
Labels
=
self
.
labels
spec
.
Labels
=
self
.
labels
spec
.
Image
=
self
.
image
spec
.
HasNetwork
=
hasNet
(
self
.
networkMode
)
return
spec
,
err
return
spec
,
err
}
}
...
@@ -247,32 +273,16 @@ func (self *dockerContainerHandler) getFsStats(stats *info.ContainerStats) error
...
@@ -247,32 +273,16 @@ func (self *dockerContainerHandler) getFsStats(stats *info.ContainerStats) error
// TODO(vmarmol): Get from libcontainer API instead of cgroup manager when we don't have to support older Dockers.
// TODO(vmarmol): Get from libcontainer API instead of cgroup manager when we don't have to support older Dockers.
func
(
self
*
dockerContainerHandler
)
GetStats
()
(
*
info
.
ContainerStats
,
error
)
{
func
(
self
*
dockerContainerHandler
)
GetStats
()
(
*
info
.
ContainerStats
,
error
)
{
config
,
err
:=
self
.
readLibcontainerConfig
()
stats
,
err
:=
containerLibcontainer
.
GetStats
(
self
.
cgroupManager
,
self
.
rootFs
,
self
.
pid
)
if
err
!=
nil
{
return
nil
,
err
}
var
networkInterfaces
[]
string
if
len
(
config
.
Networks
)
>
0
{
// ContainerStats only reports stat for one network device.
// TODO(vmarmol): Handle multiple physical network devices.
for
_
,
n
:=
range
config
.
Networks
{
// Take the first non-loopback.
if
n
.
Type
!=
"loopback"
{
networkInterfaces
=
[]
string
{
n
.
HostInterfaceName
}
break
}
}
}
stats
,
err
:=
containerLibcontainer
.
GetStats
(
self
.
cgroupManager
,
networkInterfaces
)
if
err
!=
nil
{
if
err
!=
nil
{
return
stats
,
err
return
stats
,
err
}
}
// Clean up stats for containers that don't have their own network - this
// TODO(rjnagal): Remove the conversion when network stats are read from libcontainer.
// includes containers running in Kubernetes pods that use the network of the
convertInterfaceStats
(
&
stats
.
Network
.
InterfaceStats
)
// infrastructure container. This stops metrics being reported multiple times
for
i
:=
range
stats
.
Network
.
Interfaces
{
// for each container in a pod.
convertInterfaceStats
(
&
stats
.
Network
.
Interfaces
[
i
])
if
!
hasNet
(
self
.
networkMode
)
{
stats
.
Network
=
info
.
NetworkStats
{}
}
}
// Get filesystem stats.
// Get filesystem stats.
...
@@ -284,21 +294,6 @@ func (self *dockerContainerHandler) GetStats() (*info.ContainerStats, error) {
...
@@ -284,21 +294,6 @@ func (self *dockerContainerHandler) GetStats() (*info.ContainerStats, error) {
return
stats
,
nil
return
stats
,
nil
}
}
func
convertInterfaceStats
(
stats
*
info
.
InterfaceStats
)
{
net
:=
*
stats
// Ingress for host veth is from the container.
// Hence tx_bytes stat on the host veth is actually number of bytes received by the container.
stats
.
RxBytes
=
net
.
TxBytes
stats
.
RxPackets
=
net
.
TxPackets
stats
.
RxErrors
=
net
.
TxErrors
stats
.
RxDropped
=
net
.
TxDropped
stats
.
TxBytes
=
net
.
RxBytes
stats
.
TxPackets
=
net
.
RxPackets
stats
.
TxErrors
=
net
.
RxErrors
stats
.
TxDropped
=
net
.
RxDropped
}
func
(
self
*
dockerContainerHandler
)
ListContainers
(
listType
container
.
ListType
)
([]
info
.
ContainerReference
,
error
)
{
func
(
self
*
dockerContainerHandler
)
ListContainers
(
listType
container
.
ListType
)
([]
info
.
ContainerReference
,
error
)
{
if
self
.
name
!=
"/docker"
{
if
self
.
name
!=
"/docker"
{
return
[]
info
.
ContainerReference
{},
nil
return
[]
info
.
ContainerReference
{},
nil
...
...
Godeps/_workspace/src/github.com/google/cadvisor/container/factory.go
View file @
d0887aec
...
@@ -23,7 +23,7 @@ import (
...
@@ -23,7 +23,7 @@ import (
type
ContainerHandlerFactory
interface
{
type
ContainerHandlerFactory
interface
{
// Create a new ContainerHandler using this factory. CanHandleAndAccept() must have returned true.
// Create a new ContainerHandler using this factory. CanHandleAndAccept() must have returned true.
NewContainerHandler
(
name
string
)
(
c
ContainerHandler
,
err
error
)
NewContainerHandler
(
name
string
,
inHostNamespace
bool
)
(
c
ContainerHandler
,
err
error
)
// Returns whether this factory can handle and accept the specified container.
// Returns whether this factory can handle and accept the specified container.
CanHandleAndAccept
(
name
string
)
(
handle
bool
,
accept
bool
,
err
error
)
CanHandleAndAccept
(
name
string
)
(
handle
bool
,
accept
bool
,
err
error
)
...
@@ -60,7 +60,7 @@ func HasFactories() bool {
...
@@ -60,7 +60,7 @@ func HasFactories() bool {
}
}
// Create a new ContainerHandler for the specified container.
// Create a new ContainerHandler for the specified container.
func
NewContainerHandler
(
name
string
)
(
ContainerHandler
,
bool
,
error
)
{
func
NewContainerHandler
(
name
string
,
inHostNamespace
bool
)
(
ContainerHandler
,
bool
,
error
)
{
factoriesLock
.
RLock
()
factoriesLock
.
RLock
()
defer
factoriesLock
.
RUnlock
()
defer
factoriesLock
.
RUnlock
()
...
@@ -76,7 +76,7 @@ func NewContainerHandler(name string) (ContainerHandler, bool, error) {
...
@@ -76,7 +76,7 @@ func NewContainerHandler(name string) (ContainerHandler, bool, error) {
return
nil
,
false
,
nil
return
nil
,
false
,
nil
}
}
glog
.
V
(
3
)
.
Infof
(
"Using factory %q for container %q"
,
factory
,
name
)
glog
.
V
(
3
)
.
Infof
(
"Using factory %q for container %q"
,
factory
,
name
)
handle
,
err
:=
factory
.
NewContainerHandler
(
name
)
handle
,
err
:=
factory
.
NewContainerHandler
(
name
,
inHostNamespace
)
return
handle
,
canAccept
,
err
return
handle
,
canAccept
,
err
}
else
{
}
else
{
glog
.
V
(
4
)
.
Infof
(
"Factory %q was unable to handle container %q"
,
factory
,
name
)
glog
.
V
(
4
)
.
Infof
(
"Factory %q was unable to handle container %q"
,
factory
,
name
)
...
...
Godeps/_workspace/src/github.com/google/cadvisor/container/factory_test.go
View file @
d0887aec
...
@@ -39,7 +39,7 @@ func (self *mockContainerHandlerFactory) CanHandleAndAccept(name string) (bool,
...
@@ -39,7 +39,7 @@ func (self *mockContainerHandlerFactory) CanHandleAndAccept(name string) (bool,
return
self
.
CanHandleValue
,
self
.
CanAcceptValue
,
nil
return
self
.
CanHandleValue
,
self
.
CanAcceptValue
,
nil
}
}
func
(
self
*
mockContainerHandlerFactory
)
NewContainerHandler
(
name
string
)
(
ContainerHandler
,
error
)
{
func
(
self
*
mockContainerHandlerFactory
)
NewContainerHandler
(
name
string
,
isHostNamespace
bool
)
(
ContainerHandler
,
error
)
{
args
:=
self
.
Called
(
name
)
args
:=
self
.
Called
(
name
)
return
args
.
Get
(
0
)
.
(
ContainerHandler
),
args
.
Error
(
1
)
return
args
.
Get
(
0
)
.
(
ContainerHandler
),
args
.
Error
(
1
)
}
}
...
@@ -60,13 +60,13 @@ func TestNewContainerHandler_FirstMatches(t *testing.T) {
...
@@ -60,13 +60,13 @@ func TestNewContainerHandler_FirstMatches(t *testing.T) {
RegisterContainerHandlerFactory
(
allwaysYes
)
RegisterContainerHandlerFactory
(
allwaysYes
)
// The yes factory should be asked to create the ContainerHandler.
// The yes factory should be asked to create the ContainerHandler.
mockContainer
,
err
:=
mockFactory
.
NewContainerHandler
(
testContainerName
)
mockContainer
,
err
:=
mockFactory
.
NewContainerHandler
(
testContainerName
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
err
)
}
}
allwaysYes
.
On
(
"NewContainerHandler"
,
testContainerName
)
.
Return
(
mockContainer
,
nil
)
allwaysYes
.
On
(
"NewContainerHandler"
,
testContainerName
)
.
Return
(
mockContainer
,
nil
)
cont
,
_
,
err
:=
NewContainerHandler
(
testContainerName
)
cont
,
_
,
err
:=
NewContainerHandler
(
testContainerName
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
err
)
}
}
...
@@ -93,13 +93,13 @@ func TestNewContainerHandler_SecondMatches(t *testing.T) {
...
@@ -93,13 +93,13 @@ func TestNewContainerHandler_SecondMatches(t *testing.T) {
RegisterContainerHandlerFactory
(
allwaysYes
)
RegisterContainerHandlerFactory
(
allwaysYes
)
// The yes factory should be asked to create the ContainerHandler.
// The yes factory should be asked to create the ContainerHandler.
mockContainer
,
err
:=
mockFactory
.
NewContainerHandler
(
testContainerName
)
mockContainer
,
err
:=
mockFactory
.
NewContainerHandler
(
testContainerName
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
err
)
}
}
allwaysYes
.
On
(
"NewContainerHandler"
,
testContainerName
)
.
Return
(
mockContainer
,
nil
)
allwaysYes
.
On
(
"NewContainerHandler"
,
testContainerName
)
.
Return
(
mockContainer
,
nil
)
cont
,
_
,
err
:=
NewContainerHandler
(
testContainerName
)
cont
,
_
,
err
:=
NewContainerHandler
(
testContainerName
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
err
)
t
.
Error
(
err
)
}
}
...
@@ -125,7 +125,7 @@ func TestNewContainerHandler_NoneMatch(t *testing.T) {
...
@@ -125,7 +125,7 @@ func TestNewContainerHandler_NoneMatch(t *testing.T) {
}
}
RegisterContainerHandlerFactory
(
allwaysNo2
)
RegisterContainerHandlerFactory
(
allwaysNo2
)
_
,
_
,
err
:=
NewContainerHandler
(
testContainerName
)
_
,
_
,
err
:=
NewContainerHandler
(
testContainerName
,
true
)
if
err
==
nil
{
if
err
==
nil
{
t
.
Error
(
"Expected NewContainerHandler to fail"
)
t
.
Error
(
"Expected NewContainerHandler to fail"
)
}
}
...
@@ -148,7 +148,7 @@ func TestNewContainerHandler_Accept(t *testing.T) {
...
@@ -148,7 +148,7 @@ func TestNewContainerHandler_Accept(t *testing.T) {
}
}
RegisterContainerHandlerFactory
(
cannotAccept
)
RegisterContainerHandlerFactory
(
cannotAccept
)
_
,
accept
,
err
:=
NewContainerHandler
(
testContainerName
)
_
,
accept
,
err
:=
NewContainerHandler
(
testContainerName
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Error
(
"Expected NewContainerHandler to succeed"
)
t
.
Error
(
"Expected NewContainerHandler to succeed"
)
}
}
...
...
Godeps/_workspace/src/github.com/google/cadvisor/container/libcontainer/helpers.go
View file @
d0887aec
...
@@ -15,14 +15,19 @@
...
@@ -15,14 +15,19 @@
package
libcontainer
package
libcontainer
import
(
import
(
"bufio"
"fmt"
"fmt"
"io/ioutil"
"path"
"path"
"regexp"
"strconv"
"strings"
"time"
"time"
"github.com/docker/libcontainer"
"github.com/docker/libcontainer"
"github.com/docker/libcontainer/cgroups"
"github.com/docker/libcontainer/cgroups"
"github.com/golang/glog"
info
"github.com/google/cadvisor/info/v1"
info
"github.com/google/cadvisor/info/v1"
"github.com/google/cadvisor/utils/sysinfo"
)
)
type
CgroupSubsystems
struct
{
type
CgroupSubsystems
struct
{
...
@@ -74,7 +79,7 @@ var supportedSubsystems map[string]struct{} = map[string]struct{}{
...
@@ -74,7 +79,7 @@ var supportedSubsystems map[string]struct{} = map[string]struct{}{
}
}
// Get cgroup and networking stats of the specified container
// Get cgroup and networking stats of the specified container
func
GetStats
(
cgroupManager
cgroups
.
Manager
,
networkInterfaces
[]
string
)
(
*
info
.
ContainerStats
,
error
)
{
func
GetStats
(
cgroupManager
cgroups
.
Manager
,
rootFs
string
,
pid
int
)
(
*
info
.
ContainerStats
,
error
)
{
cgroupStats
,
err
:=
cgroupManager
.
GetStats
()
cgroupStats
,
err
:=
cgroupManager
.
GetStats
()
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -84,23 +89,90 @@ func GetStats(cgroupManager cgroups.Manager, networkInterfaces []string) (*info.
...
@@ -84,23 +89,90 @@ func GetStats(cgroupManager cgroups.Manager, networkInterfaces []string) (*info.
}
}
stats
:=
toContainerStats
(
libcontainerStats
)
stats
:=
toContainerStats
(
libcontainerStats
)
// TODO(rjnagal): Use networking stats directly from libcontainer.
// If we know the pid then get network stats from /proc/<pid>/net/dev
stats
.
Network
.
Interfaces
=
make
([]
info
.
InterfaceStats
,
len
(
networkInterfaces
))
if
pid
>
0
{
for
i
:=
range
networkInterfaces
{
netStats
,
err
:=
networkStatsFromProc
(
rootFs
,
pid
)
interfaceStats
,
err
:=
sysinfo
.
GetNetworkStats
(
networkInterfaces
[
i
])
if
err
!=
nil
{
if
err
!=
nil
{
return
stats
,
err
glog
.
V
(
2
)
.
Infof
(
"Unable to get network stats from pid %d: %v"
,
pid
,
err
)
}
else
{
stats
.
Network
.
Interfaces
=
append
(
stats
.
Network
.
Interfaces
,
netStats
...
)
}
}
stats
.
Network
.
Interfaces
[
i
]
=
interfaceStats
}
}
// For backwards compatibility.
// For backwards compatibility.
if
len
(
network
Interfaces
)
>
0
{
if
len
(
stats
.
Network
.
Interfaces
)
>
0
{
stats
.
Network
.
InterfaceStats
=
stats
.
Network
.
Interfaces
[
0
]
stats
.
Network
.
InterfaceStats
=
stats
.
Network
.
Interfaces
[
0
]
}
}
return
stats
,
nil
return
stats
,
nil
}
}
func
networkStatsFromProc
(
rootFs
string
,
pid
int
)
([]
info
.
InterfaceStats
,
error
)
{
netStatsFile
:=
path
.
Join
(
rootFs
,
"proc"
,
strconv
.
Itoa
(
pid
),
"/net/dev"
)
ifaceStats
,
err
:=
scanInterfaceStats
(
netStatsFile
)
if
err
!=
nil
{
return
[]
info
.
InterfaceStats
{},
fmt
.
Errorf
(
"couldn't read network stats: %v"
,
err
)
}
return
ifaceStats
,
nil
}
var
(
ignoredDevicePrefixes
=
[]
string
{
"lo"
,
"veth"
,
"docker"
}
netStatLineRE
=
regexp
.
MustCompile
(
"[ ]*(.+):([ ]+[0-9]+){16}"
)
)
func
isIgnoredDevice
(
ifName
string
)
bool
{
for
_
,
prefix
:=
range
ignoredDevicePrefixes
{
if
strings
.
HasPrefix
(
strings
.
ToLower
(
ifName
),
prefix
)
{
return
true
}
}
return
false
}
func
scanInterfaceStats
(
netStatsFile
string
)
([]
info
.
InterfaceStats
,
error
)
{
var
(
bkt
uint64
)
stats
:=
[]
info
.
InterfaceStats
{}
data
,
err
:=
ioutil
.
ReadFile
(
netStatsFile
)
if
err
!=
nil
{
return
stats
,
fmt
.
Errorf
(
"failure opening %s: %v"
,
netStatsFile
,
err
)
}
reader
:=
strings
.
NewReader
(
string
(
data
))
scanner
:=
bufio
.
NewScanner
(
reader
)
scanner
.
Split
(
bufio
.
ScanLines
)
for
scanner
.
Scan
()
{
line
:=
scanner
.
Text
()
if
netStatLineRE
.
MatchString
(
line
)
{
line
=
strings
.
Replace
(
line
,
":"
,
""
,
-
1
)
i
:=
info
.
InterfaceStats
{}
_
,
err
:=
fmt
.
Sscanf
(
line
,
"%s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d"
,
&
i
.
Name
,
&
i
.
RxBytes
,
&
i
.
RxPackets
,
&
i
.
RxErrors
,
&
i
.
RxDropped
,
&
bkt
,
&
bkt
,
&
bkt
,
&
bkt
,
&
i
.
TxBytes
,
&
i
.
TxPackets
,
&
i
.
TxErrors
,
&
i
.
TxDropped
,
&
bkt
,
&
bkt
,
&
bkt
,
&
bkt
)
if
err
!=
nil
{
return
stats
,
fmt
.
Errorf
(
"failure opening %s: %v"
,
netStatsFile
,
err
)
}
if
!
isIgnoredDevice
(
i
.
Name
)
{
stats
=
append
(
stats
,
i
)
}
}
}
return
stats
,
nil
}
func
GetProcesses
(
cgroupManager
cgroups
.
Manager
)
([]
int
,
error
)
{
func
GetProcesses
(
cgroupManager
cgroups
.
Manager
)
([]
int
,
error
)
{
pids
,
err
:=
cgroupManager
.
GetPids
()
pids
,
err
:=
cgroupManager
.
GetPids
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
Godeps/_workspace/src/github.com/google/cadvisor/container/mock.go
View file @
d0887aec
...
@@ -109,7 +109,7 @@ func (self *FactoryForMockContainerHandler) String() string {
...
@@ -109,7 +109,7 @@ func (self *FactoryForMockContainerHandler) String() string {
return
self
.
Name
return
self
.
Name
}
}
func
(
self
*
FactoryForMockContainerHandler
)
NewContainerHandler
(
name
string
)
(
ContainerHandler
,
error
)
{
func
(
self
*
FactoryForMockContainerHandler
)
NewContainerHandler
(
name
string
,
inHostNamespace
bool
)
(
ContainerHandler
,
error
)
{
handler
:=
&
MockContainerHandler
{}
handler
:=
&
MockContainerHandler
{}
if
self
.
PrepareContainerHandlerFunc
!=
nil
{
if
self
.
PrepareContainerHandlerFunc
!=
nil
{
self
.
PrepareContainerHandlerFunc
(
name
,
handler
)
self
.
PrepareContainerHandlerFunc
(
name
,
handler
)
...
...
Godeps/_workspace/src/github.com/google/cadvisor/container/raw/factory.go
View file @
d0887aec
...
@@ -45,8 +45,12 @@ func (self *rawFactory) String() string {
...
@@ -45,8 +45,12 @@ func (self *rawFactory) String() string {
return
"raw"
return
"raw"
}
}
func
(
self
*
rawFactory
)
NewContainerHandler
(
name
string
)
(
container
.
ContainerHandler
,
error
)
{
func
(
self
*
rawFactory
)
NewContainerHandler
(
name
string
,
inHostNamespace
bool
)
(
container
.
ContainerHandler
,
error
)
{
return
newRawContainerHandler
(
name
,
self
.
cgroupSubsystems
,
self
.
machineInfoFactory
,
self
.
fsInfo
,
self
.
watcher
)
rootFs
:=
"/"
if
!
inHostNamespace
{
rootFs
=
"/rootfs"
}
return
newRawContainerHandler
(
name
,
self
.
cgroupSubsystems
,
self
.
machineInfoFactory
,
self
.
fsInfo
,
self
.
watcher
,
rootFs
)
}
}
// The raw factory can handle any container. If --docker_only is set to false, non-docker containers are ignored.
// The raw factory can handle any container. If --docker_only is set to false, non-docker containers are ignored.
...
...
Godeps/_workspace/src/github.com/google/cadvisor/container/raw/handler.go
View file @
d0887aec
...
@@ -61,9 +61,11 @@ type rawContainerHandler struct {
...
@@ -61,9 +61,11 @@ type rawContainerHandler struct {
fsInfo
fs
.
FsInfo
fsInfo
fs
.
FsInfo
externalMounts
[]
mount
externalMounts
[]
mount
rootFs
string
}
}
func
newRawContainerHandler
(
name
string
,
cgroupSubsystems
*
libcontainer
.
CgroupSubsystems
,
machineInfoFactory
info
.
MachineInfoFactory
,
fsInfo
fs
.
FsInfo
,
watcher
*
InotifyWatcher
)
(
container
.
ContainerHandler
,
error
)
{
func
newRawContainerHandler
(
name
string
,
cgroupSubsystems
*
libcontainer
.
CgroupSubsystems
,
machineInfoFactory
info
.
MachineInfoFactory
,
fsInfo
fs
.
FsInfo
,
watcher
*
InotifyWatcher
,
rootFs
string
)
(
container
.
ContainerHandler
,
error
)
{
// Create the cgroup paths.
// Create the cgroup paths.
cgroupPaths
:=
make
(
map
[
string
]
string
,
len
(
cgroupSubsystems
.
MountPoints
))
cgroupPaths
:=
make
(
map
[
string
]
string
,
len
(
cgroupSubsystems
.
MountPoints
))
for
key
,
val
:=
range
cgroupSubsystems
.
MountPoints
{
for
key
,
val
:=
range
cgroupSubsystems
.
MountPoints
{
...
@@ -108,6 +110,7 @@ func newRawContainerHandler(name string, cgroupSubsystems *libcontainer.CgroupSu
...
@@ -108,6 +110,7 @@ func newRawContainerHandler(name string, cgroupSubsystems *libcontainer.CgroupSu
hasNetwork
:
hasNetwork
,
hasNetwork
:
hasNetwork
,
externalMounts
:
externalMounts
,
externalMounts
:
externalMounts
,
watcher
:
watcher
,
watcher
:
watcher
,
rootFs
:
rootFs
,
},
nil
},
nil
}
}
...
@@ -326,15 +329,7 @@ func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error {
...
@@ -326,15 +329,7 @@ func (self *rawContainerHandler) getFsStats(stats *info.ContainerStats) error {
}
}
func
(
self
*
rawContainerHandler
)
GetStats
()
(
*
info
.
ContainerStats
,
error
)
{
func
(
self
*
rawContainerHandler
)
GetStats
()
(
*
info
.
ContainerStats
,
error
)
{
nd
,
err
:=
self
.
GetRootNetworkDevices
()
stats
,
err
:=
libcontainer
.
GetStats
(
self
.
cgroupManager
,
self
.
rootFs
,
os
.
Getpid
())
if
err
!=
nil
{
return
new
(
info
.
ContainerStats
),
err
}
networkInterfaces
:=
make
([]
string
,
len
(
nd
))
for
i
:=
range
nd
{
networkInterfaces
[
i
]
=
nd
[
i
]
.
Name
}
stats
,
err
:=
libcontainer
.
GetStats
(
self
.
cgroupManager
,
networkInterfaces
)
if
err
!=
nil
{
if
err
!=
nil
{
return
stats
,
err
return
stats
,
err
}
}
...
...
Godeps/_workspace/src/github.com/google/cadvisor/info/v1/container.go
View file @
d0887aec
...
@@ -61,6 +61,9 @@ type ContainerSpec struct {
...
@@ -61,6 +61,9 @@ type ContainerSpec struct {
HasCustomMetrics
bool
`json:"has_custom_metrics"`
HasCustomMetrics
bool
`json:"has_custom_metrics"`
CustomMetrics
[]
MetricSpec
`json:"custom_metrics,omitempty"`
CustomMetrics
[]
MetricSpec
`json:"custom_metrics,omitempty"`
// Image name used for this container.
Image
string
`json:"image,omitempty"`
}
}
// Container reference contains enough information to uniquely identify a container
// Container reference contains enough information to uniquely identify a container
...
...
Godeps/_workspace/src/github.com/google/cadvisor/info/v2/container.go
View file @
d0887aec
...
@@ -80,14 +80,20 @@ type ContainerSpec struct {
...
@@ -80,14 +80,20 @@ type ContainerSpec struct {
HasNetwork
bool
`json:"has_network"`
HasNetwork
bool
`json:"has_network"`
HasFilesystem
bool
`json:"has_filesystem"`
HasFilesystem
bool
`json:"has_filesystem"`
HasDiskIo
bool
`json:"has_diskio"`
HasDiskIo
bool
`json:"has_diskio"`
// Image name used for this container.
Image
string
`json:"image,omitempty"`
}
}
type
ContainerStats
struct
{
type
ContainerStats
struct
{
// The time of this stat point.
// The time of this stat point.
Timestamp
time
.
Time
`json:"timestamp"`
Timestamp
time
.
Time
`json:"timestamp"`
// CPU statistics
// CPU statistics
HasCpu
bool
`json:"has_cpu"`
HasCpu
bool
`json:"has_cpu"`
Cpu
v1
.
CpuStats
`json:"cpu,omitempty"`
// In nanoseconds (aggregated)
Cpu
v1
.
CpuStats
`json:"cpu,omitempty"`
// In nanocores per second (instantaneous)
CpuInst
*
CpuInstStats
`json:"cpu_inst,omitempty"`
// Disk IO statistics
// Disk IO statistics
HasDiskIo
bool
`json:"has_diskio"`
HasDiskIo
bool
`json:"has_diskio"`
DiskIo
v1
.
DiskIoStats
`json:"diskio,omitempty"`
DiskIo
v1
.
DiskIoStats
`json:"diskio,omitempty"`
...
@@ -204,3 +210,27 @@ type NetworkStats struct {
...
@@ -204,3 +210,27 @@ type NetworkStats struct {
// Network stats by interface.
// Network stats by interface.
Interfaces
[]
v1
.
InterfaceStats
`json:"interfaces,omitempty"`
Interfaces
[]
v1
.
InterfaceStats
`json:"interfaces,omitempty"`
}
}
// Instantaneous CPU stats
type
CpuInstStats
struct
{
Usage
CpuInstUsage
`json:"usage"`
}
// CPU usage time statistics.
type
CpuInstUsage
struct
{
// Total CPU usage.
// Units: nanocores per second
Total
uint64
`json:"total"`
// Per CPU/core usage of the container.
// Unit: nanocores per second
PerCpu
[]
uint64
`json:"per_cpu_usage,omitempty"`
// Time spent in user space.
// Unit: nanocores per second
User
uint64
`json:"user"`
// Time spent in kernel space.
// Unit: nanocores per second
System
uint64
`json:"system"`
}
Godeps/_workspace/src/github.com/google/cadvisor/manager/manager.go
View file @
d0887aec
...
@@ -380,6 +380,7 @@ func (self *manager) getV2Spec(cinfo *containerInfo) v2.ContainerSpec {
...
@@ -380,6 +380,7 @@ func (self *manager) getV2Spec(cinfo *containerInfo) v2.ContainerSpec {
HasNetwork
:
specV1
.
HasNetwork
,
HasNetwork
:
specV1
.
HasNetwork
,
HasDiskIo
:
specV1
.
HasDiskIo
,
HasDiskIo
:
specV1
.
HasDiskIo
,
HasCustomMetrics
:
specV1
.
HasCustomMetrics
,
HasCustomMetrics
:
specV1
.
HasCustomMetrics
,
Image
:
specV1
.
Image
,
}
}
if
specV1
.
HasCpu
{
if
specV1
.
HasCpu
{
specV2
.
Cpu
.
Limit
=
specV1
.
Cpu
.
Limit
specV2
.
Cpu
.
Limit
=
specV1
.
Cpu
.
Limit
...
@@ -736,7 +737,7 @@ func (m *manager) registerCollectors(collectorConfigs map[string]string, cont *c
...
@@ -736,7 +737,7 @@ func (m *manager) registerCollectors(collectorConfigs map[string]string, cont *c
// Create a container.
// Create a container.
func
(
m
*
manager
)
createContainer
(
containerName
string
)
error
{
func
(
m
*
manager
)
createContainer
(
containerName
string
)
error
{
handler
,
accept
,
err
:=
container
.
NewContainerHandler
(
containerName
)
handler
,
accept
,
err
:=
container
.
NewContainerHandler
(
containerName
,
m
.
inHostNamespace
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
...
Godeps/_workspace/src/github.com/google/cadvisor/metrics/prometheus.go
View file @
d0887aec
...
@@ -61,7 +61,7 @@ type containerMetric struct {
...
@@ -61,7 +61,7 @@ type containerMetric struct {
}
}
func
(
cm
*
containerMetric
)
desc
()
*
prometheus
.
Desc
{
func
(
cm
*
containerMetric
)
desc
()
*
prometheus
.
Desc
{
return
prometheus
.
NewDesc
(
cm
.
name
,
cm
.
help
,
append
([]
string
{
"name"
,
"id"
},
cm
.
extraLabels
...
),
nil
)
return
prometheus
.
NewDesc
(
cm
.
name
,
cm
.
help
,
append
([]
string
{
"name"
,
"id"
,
"image"
},
cm
.
extraLabels
...
),
nil
)
}
}
// PrometheusCollector implements prometheus.Collector.
// PrometheusCollector implements prometheus.Collector.
...
@@ -287,60 +287,124 @@ func NewPrometheusCollector(infoProvider subcontainersInfoProvider) *PrometheusC
...
@@ -287,60 +287,124 @@ func NewPrometheusCollector(infoProvider subcontainersInfoProvider) *PrometheusC
})
})
},
},
},
{
},
{
name
:
"container_network_receive_bytes_total"
,
name
:
"container_network_receive_bytes_total"
,
help
:
"Cumulative count of bytes received"
,
help
:
"Cumulative count of bytes received"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
RxBytes
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
RxBytes
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_network_receive_packets_total"
,
name
:
"container_network_receive_packets_total"
,
help
:
"Cumulative count of packets received"
,
help
:
"Cumulative count of packets received"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
RxPackets
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
RxPackets
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_network_receive_packets_dropped_total"
,
name
:
"container_network_receive_packets_dropped_total"
,
help
:
"Cumulative count of packets dropped while receiving"
,
help
:
"Cumulative count of packets dropped while receiving"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
RxDropped
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
RxDropped
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_network_receive_errors_total"
,
name
:
"container_network_receive_errors_total"
,
help
:
"Cumulative count of errors encountered while receiving"
,
help
:
"Cumulative count of errors encountered while receiving"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
RxErrors
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
RxErrors
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_network_transmit_bytes_total"
,
name
:
"container_network_transmit_bytes_total"
,
help
:
"Cumulative count of bytes transmitted"
,
help
:
"Cumulative count of bytes transmitted"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
TxBytes
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
TxBytes
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_network_transmit_packets_total"
,
name
:
"container_network_transmit_packets_total"
,
help
:
"Cumulative count of packets transmitted"
,
help
:
"Cumulative count of packets transmitted"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
TxPackets
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
TxPackets
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_network_transmit_packets_dropped_total"
,
name
:
"container_network_transmit_packets_dropped_total"
,
help
:
"Cumulative count of packets dropped while transmitting"
,
help
:
"Cumulative count of packets dropped while transmitting"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
TxDropped
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
TxDropped
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_network_transmit_errors_total"
,
name
:
"container_network_transmit_errors_total"
,
help
:
"Cumulative count of errors encountered while transmitting"
,
help
:
"Cumulative count of errors encountered while transmitting"
,
valueType
:
prometheus
.
CounterValue
,
valueType
:
prometheus
.
CounterValue
,
extraLabels
:
[]
string
{
"interface"
},
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
getValues
:
func
(
s
*
info
.
ContainerStats
)
metricValues
{
return
metricValues
{{
value
:
float64
(
s
.
Network
.
TxErrors
)}}
values
:=
make
(
metricValues
,
0
,
len
(
s
.
Network
.
Interfaces
))
for
_
,
value
:=
range
s
.
Network
.
Interfaces
{
values
=
append
(
values
,
metricValue
{
value
:
float64
(
value
.
TxErrors
),
labels
:
[]
string
{
value
.
Name
},
})
}
return
values
},
},
},
{
},
{
name
:
"container_tasks_state"
,
name
:
"container_tasks_state"
,
...
@@ -401,12 +465,13 @@ func (c *PrometheusCollector) Collect(ch chan<- prometheus.Metric) {
...
@@ -401,12 +465,13 @@ func (c *PrometheusCollector) Collect(ch chan<- prometheus.Metric) {
if
len
(
container
.
Aliases
)
>
0
{
if
len
(
container
.
Aliases
)
>
0
{
name
=
container
.
Aliases
[
0
]
name
=
container
.
Aliases
[
0
]
}
}
image
:=
container
.
Spec
.
Image
stats
:=
container
.
Stats
[
0
]
stats
:=
container
.
Stats
[
0
]
for
_
,
cm
:=
range
c
.
containerMetrics
{
for
_
,
cm
:=
range
c
.
containerMetrics
{
desc
:=
cm
.
desc
()
desc
:=
cm
.
desc
()
for
_
,
metricValue
:=
range
cm
.
getValues
(
stats
)
{
for
_
,
metricValue
:=
range
cm
.
getValues
(
stats
)
{
ch
<-
prometheus
.
MustNewConstMetric
(
desc
,
cm
.
valueType
,
float64
(
metricValue
.
value
),
append
([]
string
{
name
,
id
},
metricValue
.
labels
...
)
...
)
ch
<-
prometheus
.
MustNewConstMetric
(
desc
,
cm
.
valueType
,
float64
(
metricValue
.
value
),
append
([]
string
{
name
,
id
,
image
},
metricValue
.
labels
...
)
...
)
}
}
}
}
}
}
...
...
Godeps/_workspace/src/github.com/google/cadvisor/metrics/prometheus_test.go
View file @
d0887aec
...
@@ -34,6 +34,9 @@ func (p testSubcontainersInfoProvider) SubcontainersInfo(string, *info.Container
...
@@ -34,6 +34,9 @@ func (p testSubcontainersInfoProvider) SubcontainersInfo(string, *info.Container
ContainerReference
:
info
.
ContainerReference
{
ContainerReference
:
info
.
ContainerReference
{
Name
:
"testcontainer"
,
Name
:
"testcontainer"
,
},
},
Spec
:
info
.
ContainerSpec
{
Image
:
"test"
,
},
Stats
:
[]
*
info
.
ContainerStats
{
Stats
:
[]
*
info
.
ContainerStats
{
{
{
Cpu
:
info
.
CpuStats
{
Cpu
:
info
.
CpuStats
{
...
@@ -68,6 +71,19 @@ func (p testSubcontainersInfoProvider) SubcontainersInfo(string, *info.Container
...
@@ -68,6 +71,19 @@ func (p testSubcontainersInfoProvider) SubcontainersInfo(string, *info.Container
TxErrors
:
20
,
TxErrors
:
20
,
TxDropped
:
21
,
TxDropped
:
21
,
},
},
Interfaces
:
[]
info
.
InterfaceStats
{
{
Name
:
"eth0"
,
RxBytes
:
14
,
RxPackets
:
15
,
RxErrors
:
16
,
RxDropped
:
17
,
TxBytes
:
18
,
TxPackets
:
19
,
TxErrors
:
20
,
TxDropped
:
21
,
},
},
},
},
Filesystem
:
[]
info
.
FsStats
{
Filesystem
:
[]
info
.
FsStats
{
{
{
...
...
Godeps/_workspace/src/github.com/google/cadvisor/metrics/testdata/prometheus_metrics
deleted
100644 → 0
View file @
a7e47cad
This diff is collapsed.
Click to expand it.
Godeps/_workspace/src/github.com/google/cadvisor/utils/machine/testdata/cpuinfo
deleted
100644 → 0
View file @
a7e47cad
processor : 0
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 0
siblings : 6
core id : 0
cpu cores : 6
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 1
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 0
siblings : 6
core id : 1
cpu cores : 6
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 2
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 0
siblings : 6
core id : 2
cpu cores : 6
apicid : 4
initial apicid : 4
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 3
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 1
siblings : 6
core id : 3
cpu cores : 6
apicid : 16
initial apicid : 16
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 4
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 1
siblings : 6
core id : 4
cpu cores : 6
apicid : 18
initial apicid : 18
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 5
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 1
siblings : 6
core id : 5
cpu cores : 6
apicid : 20
initial apicid : 20
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 6
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 2661.000
cache size : 12288 KB
physical id : 0
siblings : 6
core id : 0
cpu cores : 6
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 7
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 2661.000
cache size : 12288 KB
physical id : 0
siblings : 6
core id : 1
cpu cores : 6
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 8
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 0
siblings : 6
core id : 2
cpu cores : 6
apicid : 5
initial apicid : 5
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 9
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 2661.000
cache size : 12288 KB
physical id : 1
siblings : 6
core id : 3
cpu cores : 6
apicid : 17
initial apicid : 17
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 10
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 1596.000
cache size : 12288 KB
physical id : 1
siblings : 6
core id : 4
cpu cores : 6
apicid : 19
initial apicid : 19
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
processor : 11
cpu family : 6
stepping : 2
microcode : 0x10
cpu MHz : 2661.000
cache size : 12288 KB
physical id : 1
siblings : 6
core id : 5
cpu cores : 6
apicid : 21
initial apicid : 21
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
bogomips : 5333.60
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
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