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
8c808947
Commit
8c808947
authored
Jun 05, 2017
by
zhengjiajin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix const nameing in node/metrics
parent
2510dc0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
metrics.go
pkg/controller/node/metrics.go
+2
-2
nodecontroller_test.go
pkg/controller/node/nodecontroller_test.go
+9
-9
No files found.
pkg/controller/node/metrics.go
View file @
8c808947
...
@@ -26,7 +26,7 @@ const (
...
@@ -26,7 +26,7 @@ const (
NodeControllerSubsystem
=
"node_collector"
NodeControllerSubsystem
=
"node_collector"
ZoneHealthStatisticKey
=
"zone_health"
ZoneHealthStatisticKey
=
"zone_health"
ZoneSizeKey
=
"zone_size"
ZoneSizeKey
=
"zone_size"
ZoneNoUnhealthyNodesKey
=
"unhealty_nodes_in_zone"
ZoneNoUnhealthyNodesKey
=
"unhealt
h
y_nodes_in_zone"
EvictionsNumberKey
=
"evictions_number"
EvictionsNumberKey
=
"evictions_number"
)
)
...
@@ -35,7 +35,7 @@ var (
...
@@ -35,7 +35,7 @@ var (
prometheus
.
GaugeOpts
{
prometheus
.
GaugeOpts
{
Subsystem
:
NodeControllerSubsystem
,
Subsystem
:
NodeControllerSubsystem
,
Name
:
ZoneHealthStatisticKey
,
Name
:
ZoneHealthStatisticKey
,
Help
:
"Gauge measuring percentage of healty nodes per zone."
,
Help
:
"Gauge measuring percentage of healt
h
y nodes per zone."
,
},
},
[]
string
{
"zone"
},
[]
string
{
"zone"
},
)
)
...
...
pkg/controller/node/nodecontroller_test.go
View file @
8c808947
...
@@ -51,7 +51,7 @@ const (
...
@@ -51,7 +51,7 @@ const (
testNodeMonitorPeriod
=
5
*
time
.
Second
testNodeMonitorPeriod
=
5
*
time
.
Second
testRateLimiterQPS
=
float32
(
10000
)
testRateLimiterQPS
=
float32
(
10000
)
testLargeClusterThreshold
=
20
testLargeClusterThreshold
=
20
testUnhealt
yThreshold
=
float32
(
0.55
)
testUnhealt
hyThreshold
=
float32
(
0.55
)
)
)
func
alwaysReady
()
bool
{
return
true
}
func
alwaysReady
()
bool
{
return
true
}
...
@@ -559,7 +559,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) {
...
@@ -559,7 +559,7 @@ func TestMonitorNodeStatusEvictPods(t *testing.T) {
testRateLimiterQPS
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
testNodeMonitorPeriod
,
...
@@ -715,7 +715,7 @@ func TestPodStatusChange(t *testing.T) {
...
@@ -715,7 +715,7 @@ func TestPodStatusChange(t *testing.T) {
for
_
,
item
:=
range
table
{
for
_
,
item
:=
range
table
{
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
item
.
fakeNodeHandler
,
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
item
.
fakeNodeHandler
,
evictionTimeout
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testNodeMonitorGracePeriod
,
evictionTimeout
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
...
@@ -1232,7 +1232,7 @@ func TestMonitorNodeStatusEvictPodsWithDisruption(t *testing.T) {
...
@@ -1232,7 +1232,7 @@ func TestMonitorNodeStatusEvictPodsWithDisruption(t *testing.T) {
Clientset
:
fake
.
NewSimpleClientset
(
&
v1
.
PodList
{
Items
:
item
.
podList
}),
Clientset
:
fake
.
NewSimpleClientset
(
&
v1
.
PodList
{
Items
:
item
.
podList
}),
}
}
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fakeNodeHandler
,
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fakeNodeHandler
,
evictionTimeout
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testNodeMonitorGracePeriod
,
evictionTimeout
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
enterPartialDisruptionFunc
=
func
(
nodeNum
int
)
float32
{
nodeController
.
enterPartialDisruptionFunc
=
func
(
nodeNum
int
)
float32
{
...
@@ -1326,7 +1326,7 @@ func TestCloudProviderNoRateLimit(t *testing.T) {
...
@@ -1326,7 +1326,7 @@ func TestCloudProviderNoRateLimit(t *testing.T) {
DeleteWaitChan
:
make
(
chan
struct
{}),
DeleteWaitChan
:
make
(
chan
struct
{}),
}
}
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fnh
,
10
*
time
.
Minute
,
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fnh
,
10
*
time
.
Minute
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
nodeController
.
cloud
=
&
fakecloud
.
FakeCloud
{}
nodeController
.
cloud
=
&
fakecloud
.
FakeCloud
{}
...
@@ -1596,7 +1596,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
...
@@ -1596,7 +1596,7 @@ func TestMonitorNodeStatusUpdateStatus(t *testing.T) {
for
i
,
item
:=
range
table
{
for
i
,
item
:=
range
table
{
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
item
.
fakeNodeHandler
,
5
*
time
.
Minute
,
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
item
.
fakeNodeHandler
,
5
*
time
.
Minute
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
...
@@ -1830,7 +1830,7 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) {
...
@@ -1830,7 +1830,7 @@ func TestMonitorNodeStatusMarkPodsNotReady(t *testing.T) {
for
i
,
item
:=
range
table
{
for
i
,
item
:=
range
table
{
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
item
.
fakeNodeHandler
,
5
*
time
.
Minute
,
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
item
.
fakeNodeHandler
,
5
*
time
.
Minute
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
...
@@ -1941,7 +1941,7 @@ func TestSwapUnreachableNotReadyTaints(t *testing.T) {
...
@@ -1941,7 +1941,7 @@ func TestSwapUnreachableNotReadyTaints(t *testing.T) {
updatedTaint
:=
NotReadyTaintTemplate
updatedTaint
:=
NotReadyTaintTemplate
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fakeNodeHandler
,
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fakeNodeHandler
,
evictionTimeout
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testNodeMonitorGracePeriod
,
evictionTimeout
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
true
)
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
true
)
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
now
=
func
()
metav1
.
Time
{
return
fakeNow
}
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
nodeController
.
recorder
=
testutil
.
NewFakeRecorder
()
...
@@ -2032,7 +2032,7 @@ func TestNodeEventGeneration(t *testing.T) {
...
@@ -2032,7 +2032,7 @@ func TestNodeEventGeneration(t *testing.T) {
}
}
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fakeNodeHandler
,
5
*
time
.
Minute
,
nodeController
,
_
:=
NewNodeControllerFromClient
(
nil
,
fakeNodeHandler
,
5
*
time
.
Minute
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealtyThreshold
,
testRateLimiterQPS
,
testRateLimiterQPS
,
testLargeClusterThreshold
,
testUnhealt
h
yThreshold
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorGracePeriod
,
testNodeStartupGracePeriod
,
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
testNodeMonitorPeriod
,
nil
,
nil
,
0
,
false
,
false
)
nodeController
.
cloud
=
&
fakecloud
.
FakeCloud
{}
nodeController
.
cloud
=
&
fakecloud
.
FakeCloud
{}
...
...
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