File tree 4 files changed +0
-29
lines changed
main/java/org/csanchez/jenkins/plugins/kubernetes
test/java/org/csanchez/jenkins/plugins/kubernetes
4 files changed +0
-29
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import static java .nio .charset .StandardCharsets .UTF_8 ;
4
4
import static org .apache .commons .lang .StringUtils .isEmpty ;
5
- import static org .csanchez .jenkins .plugins .kubernetes .MetricNames .metricNameForLabel ;
6
5
7
6
import com .cloudbees .plugins .credentials .CredentialsMatchers ;
8
7
import com .cloudbees .plugins .credentials .common .StandardCredentials ;
@@ -599,7 +598,6 @@ public Collection<NodeProvisioner.PlannedNode> provision(
599
598
@ NonNull final Cloud .CloudState state , final int excessWorkload ) {
600
599
var limitRegistrationResults = new LimitRegistrationResults (this );
601
600
try {
602
- Metrics .metricRegistry ().meter (metricNameForLabel (state .getLabel ())).mark (excessWorkload );
603
601
Label label = state .getLabel ();
604
602
// Planned nodes, will be launched on the next round of NodeProvisioner
605
603
int plannedCapacity = state .getAdditionalPlannedCapacity ();
Original file line number Diff line number Diff line change 1
1
package org .csanchez .jenkins .plugins .kubernetes ;
2
2
3
- import hudson .model .Label ;
4
3
import java .util .Locale ;
5
4
6
5
public class MetricNames {
@@ -21,9 +20,4 @@ public static String metricNameForPodStatus(String status) {
21
20
String formattedStatus = status == null ? "null" : status .toLowerCase (Locale .getDefault ());
22
21
return PREFIX + ".pods.launch.status." + formattedStatus ;
23
22
}
24
-
25
- public static String metricNameForLabel (Label label ) {
26
- String labelText = (label == null ) ? "nolabel" : label .getDisplayName ();
27
- return String .format ("%s.%s.provision.request" , PREFIX , labelText );
28
- }
29
23
}
Original file line number Diff line number Diff line change 1
1
package org .csanchez .jenkins .plugins .kubernetes ;
2
2
3
- import hudson .model .labels .LabelAtom ;
4
3
import org .junit .Assert ;
5
4
import org .junit .Test ;
6
5
@@ -29,20 +28,4 @@ public void metricNameForPodStatusChangeStatusToLowercase() {
29
28
30
29
Assert .assertEquals (expected , actual );
31
30
}
32
-
33
- @ Test
34
- public void metricNameForLabelAddsNoLabelIfLabelIsNull () {
35
- String expected = "kubernetes.cloud.nolabel.provision.request" ;
36
- String actual = MetricNames .metricNameForLabel (null );
37
-
38
- Assert .assertEquals (expected , actual );
39
- }
40
-
41
- @ Test
42
- public void metricNameForLabelAddsLabelValue () {
43
- String expected = "kubernetes.cloud.java.provision.request" ;
44
- String actual = MetricNames .metricNameForLabel (new LabelAtom ("java" ));
45
-
46
- Assert .assertEquals (expected , actual );
47
- }
48
31
}
Original file line number Diff line number Diff line change @@ -252,10 +252,6 @@ public void runInPod() throws Exception {
252
252
emptyIterable ());
253
253
254
254
assertTrue (Metrics .metricRegistry ().counter (MetricNames .PODS_LAUNCHED ).getCount () > 0 );
255
- assertTrue (Metrics .metricRegistry ()
256
- .meter (MetricNames .metricNameForLabel (Label .parseExpression ("runInPod" )))
257
- .getCount ()
258
- > 0 );
259
255
}
260
256
261
257
@ Test
You can’t perform that action at this time.
0 commit comments