@@ -302,119 +302,6 @@ type Bucket struct {
302
302
Val int
303
303
}
304
304
305
- // GetReloadCount gets the total number of nginx reloads.
306
- func GetReloadCount (promInstance PrometheusInstance , ngfPodName string ) (float64 , error ) {
307
- return getFirstValueOfVector (
308
- fmt .Sprintf (
309
- `nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}` ,
310
- ngfPodName ,
311
- ),
312
- promInstance ,
313
- )
314
- }
315
-
316
- // GetReloadCountWithStartTime gets the total number of nginx reloads from a start time to the current time.
317
- func GetReloadCountWithStartTime (
318
- promInstance PrometheusInstance ,
319
- ngfPodName string ,
320
- startTime time.Time ,
321
- ) (float64 , error ) {
322
- return getFirstValueOfVector (
323
- fmt .Sprintf (
324
- `nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}` +
325
- ` - ` +
326
- `nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"} @ %d` ,
327
- ngfPodName ,
328
- startTime .Unix (),
329
- ),
330
- promInstance ,
331
- )
332
- }
333
-
334
- // GetReloadErrsCountWithStartTime gets the total number of nginx reload errors from a start time to the current time.
335
- func GetReloadErrsCountWithStartTime (
336
- promInstance PrometheusInstance ,
337
- ngfPodName string ,
338
- startTime time.Time ,
339
- ) (float64 , error ) {
340
- return getFirstValueOfVector (
341
- fmt .Sprintf (
342
- `nginx_gateway_fabric_nginx_reload_errors_total{pod="%[1]s"}` +
343
- ` - ` +
344
- `nginx_gateway_fabric_nginx_reload_errors_total{pod="%[1]s"} @ %d` ,
345
- ngfPodName ,
346
- startTime .Unix (),
347
- ),
348
- promInstance ,
349
- )
350
- }
351
-
352
- // GetReloadAvgTime gets the average time in milliseconds for nginx to reload.
353
- func GetReloadAvgTime (promInstance PrometheusInstance , ngfPodName string ) (float64 , error ) {
354
- return getFirstValueOfVector (
355
- fmt .Sprintf (
356
- `nginx_gateway_fabric_nginx_reloads_milliseconds_sum{pod="%[1]s"}` +
357
- ` / ` +
358
- `nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}` ,
359
- ngfPodName ,
360
- ),
361
- promInstance ,
362
- )
363
- }
364
-
365
- // GetReloadAvgTimeWithStartTime gets the average time in milliseconds for nginx to reload using a start time
366
- // to the current time to calculate.
367
- func GetReloadAvgTimeWithStartTime (
368
- promInstance PrometheusInstance ,
369
- ngfPodName string ,
370
- startTime time.Time ,
371
- ) (float64 , error ) {
372
- return getFirstValueOfVector (
373
- fmt .Sprintf (
374
- `(nginx_gateway_fabric_nginx_reloads_milliseconds_sum{pod="%[1]s"}` +
375
- ` - ` +
376
- `nginx_gateway_fabric_nginx_reloads_milliseconds_sum{pod="%[1]s"} @ %[2]d)` +
377
- ` / ` +
378
- `(nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"}` +
379
- ` - ` +
380
- `nginx_gateway_fabric_nginx_reloads_total{pod="%[1]s"} @ %[2]d)` ,
381
- ngfPodName ,
382
- startTime .Unix (),
383
- ),
384
- promInstance ,
385
- )
386
- }
387
-
388
- // GetReloadBuckets gets the Buckets in millisecond intervals for nginx reloads.
389
- func GetReloadBuckets (promInstance PrometheusInstance , ngfPodName string ) ([]Bucket , error ) {
390
- return getBuckets (
391
- fmt .Sprintf (
392
- `nginx_gateway_fabric_nginx_reloads_milliseconds_bucket{pod="%[1]s"}` ,
393
- ngfPodName ,
394
- ),
395
- promInstance ,
396
- )
397
- }
398
-
399
- // GetReloadBucketsWithStartTime gets the Buckets in millisecond intervals for nginx reloads from a start time
400
- // to the current time.
401
- func GetReloadBucketsWithStartTime (
402
- promInstance PrometheusInstance ,
403
- ngfPodName string ,
404
- startTime time.Time ,
405
- ) ([]Bucket , error ) {
406
- return getBuckets (
407
- fmt .Sprintf (
408
- `nginx_gateway_fabric_nginx_reloads_milliseconds_bucket{pod="%[1]s"}` +
409
- ` - ` +
410
- `nginx_gateway_fabric_nginx_reloads_milliseconds_bucket{pod="%[1]s"} @ %d` ,
411
- ngfPodName ,
412
- startTime .Unix (),
413
- ),
414
- promInstance ,
415
- )
416
- }
417
-
418
305
// GetEventsCount gets the NGF event batch processing count.
419
306
func GetEventsCount (promInstance PrometheusInstance , ngfPodName string ) (float64 , error ) {
420
307
return getFirstValueOfVector (
0 commit comments