@@ -48,6 +48,7 @@ func TestHPAStore(t *testing.T) {
48
48
# HELP kube_horizontalpodautoscaler_status_current_replicas [STABLE] Current number of replicas of pods managed by this autoscaler.
49
49
# HELP kube_horizontalpodautoscaler_status_desired_replicas [STABLE] Desired number of replicas of pods managed by this autoscaler.
50
50
# HELP kube_horizontalpodautoscaler_created Unix creation timestamp
51
+ # HELP kube_horizontalpodautoscaler_deletion_timestamp Unix deletion timestamp
51
52
# TYPE kube_horizontalpodautoscaler_info gauge
52
53
# TYPE kube_horizontalpodautoscaler_annotations gauge
53
54
# TYPE kube_horizontalpodautoscaler_labels gauge
@@ -60,6 +61,7 @@ func TestHPAStore(t *testing.T) {
60
61
# TYPE kube_horizontalpodautoscaler_status_current_replicas gauge
61
62
# TYPE kube_horizontalpodautoscaler_status_desired_replicas gauge
62
63
# TYPE kube_horizontalpodautoscaler_created gauge
64
+ # TYPE kube_horizontalpodautoscaler_deletion_timestamp gauge
63
65
`
64
66
cases := []generateMetricsTestCase {
65
67
{
@@ -69,6 +71,7 @@ func TestHPAStore(t *testing.T) {
69
71
Generation : 2 ,
70
72
Name : "hpa1" ,
71
73
CreationTimestamp : metav1.Time {Time : time .Unix (1500000000 , 0 )},
74
+ DeletionTimestamp : & metav1.Time {Time : time .Unix (1800000000 , 0 )},
72
75
Namespace : "ns1" ,
73
76
Labels : map [string ]string {
74
77
"app" : "foobar" ,
@@ -238,6 +241,7 @@ func TestHPAStore(t *testing.T) {
238
241
kube_horizontalpodautoscaler_status_current_replicas{horizontalpodautoscaler="hpa1",namespace="ns1"} 2
239
242
kube_horizontalpodautoscaler_status_desired_replicas{horizontalpodautoscaler="hpa1",namespace="ns1"} 2
240
243
kube_horizontalpodautoscaler_created{horizontalpodautoscaler="hpa1",namespace="ns1"} 1.5e+09
244
+ kube_horizontalpodautoscaler_deletion_timestamp{horizontalpodautoscaler="hpa1",namespace="ns1"} 1.8e+09
241
245
` ,
242
246
MetricNames : []string {
243
247
"kube_horizontalpodautoscaler_info" ,
@@ -252,6 +256,7 @@ func TestHPAStore(t *testing.T) {
252
256
"kube_horizontalpodautoscaler_annotations" ,
253
257
"kube_horizontalpodautoscaler_labels" ,
254
258
"kube_horizontalpodautoscaler_created" ,
259
+ "kube_horizontalpodautoscaler_deletion_timestamp" ,
255
260
},
256
261
},
257
262
{
@@ -264,6 +269,7 @@ func TestHPAStore(t *testing.T) {
264
269
Generation : 2 ,
265
270
Name : "hpa2" ,
266
271
CreationTimestamp : metav1.Time {Time : time .Unix (1500000000 , 0 )},
272
+ DeletionTimestamp : & metav1.Time {Time : time .Unix (1800000000 , 0 )},
267
273
Namespace : "ns1" ,
268
274
Labels : map [string ]string {
269
275
"app" : "foobar" ,
@@ -416,6 +422,7 @@ func TestHPAStore(t *testing.T) {
416
422
kube_horizontalpodautoscaler_status_current_replicas{horizontalpodautoscaler="hpa2",namespace="ns1"} 2
417
423
kube_horizontalpodautoscaler_status_desired_replicas{horizontalpodautoscaler="hpa2",namespace="ns1"} 2
418
424
kube_horizontalpodautoscaler_created{horizontalpodautoscaler="hpa2",namespace="ns1"} 1.5e+09
425
+ kube_horizontalpodautoscaler_deletion_timestamp{horizontalpodautoscaler="hpa2",namespace="ns1"} 1.8e+09
419
426
` ,
420
427
MetricNames : []string {
421
428
"kube_horizontalpodautoscaler_info" ,
@@ -430,6 +437,7 @@ func TestHPAStore(t *testing.T) {
430
437
"kube_horizontalpodautoscaler_annotation" ,
431
438
"kube_horizontalpodautoscaler_labels" ,
432
439
"kube_horizontalpodautoscaler_created" ,
440
+ "kube_horizontalpodautoscaler_deletion_timestamp" ,
433
441
},
434
442
},
435
443
}
0 commit comments