Commit 8dabdf70 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #46955 from zjj2wry/nodecontroller_matrics

Automatic merge from submit-queue Fix const naming in node/metrics **What this PR does / why we need it**: **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 156ff3a7 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 = "unhealthy_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 healthy nodes per zone.",
}, },
[]string{"zone"}, []string{"zone"},
) )
......
...@@ -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
testUnhealtyThreshold = float32(0.55) testUnhealthyThreshold = 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, testUnhealthyThreshold,
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, testUnhealthyThreshold, 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, testUnhealthyThreshold, 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, testUnhealthyThreshold,
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, testUnhealthyThreshold,
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, testUnhealthyThreshold,
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, testUnhealthyThreshold, 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, testUnhealthyThreshold,
testNodeMonitorGracePeriod, testNodeStartupGracePeriod, testNodeMonitorGracePeriod, testNodeStartupGracePeriod,
testNodeMonitorPeriod, nil, nil, 0, false, false) testNodeMonitorPeriod, nil, nil, 0, false, false)
nodeController.cloud = &fakecloud.FakeCloud{} nodeController.cloud = &fakecloud.FakeCloud{}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment