Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ResetWebhookMetricsForTest (0.26 sec)

  1. staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics/metrics_test.go

                apiserver_authorization_webhook_evaluations_total{name="wh1.example.com",result="timeout"} 1
                `,
    		},
    	}
    
    	for _, tt := range testCases {
    		t.Run(tt.desc, func(t *testing.T) {
    			ResetWebhookMetricsForTest()
    			m := NewWebhookMetrics()
    			m.RecordWebhookDuration(context.Background(), tt.name, tt.result, tt.duration)
    			m.RecordWebhookEvaluation(context.Background(), tt.name, tt.result)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 04 19:01:15 UTC 2024
    - 4.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/metrics/metrics.go

    		},
    		[]string{"name", "result"},
    	)
    )
    
    type webhookMetrics struct{}
    
    func NewWebhookMetrics() WebhookMetrics {
    	RegisterWebhookMetrics()
    	return webhookMetrics{}
    }
    
    func ResetWebhookMetricsForTest() {
    	webhookEvaluations.Reset()
    	webhookDuration.Reset()
    	webhookFailOpen.Reset()
    }
    
    func (webhookMetrics) RecordWebhookEvaluation(ctx context.Context, name, result string) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 04 19:01:15 UTC 2024
    - 5.5K bytes
    - Viewed (0)
Back to top