github.com/cilium/cilium@v1.16.2/pkg/hubble/metrics/http/plugin_test.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // Copyright Authors of Hubble
     3  
     4  package http
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/assert"
    10  )
    11  
    12  func Test_httpPlugin_HelpText(t *testing.T) {
    13  	plugin := &httpPlugin{}
    14  	expected := `http - HTTP metrics
    15  Metrics related to the HTTP protocol
    16  
    17  Metrics:
    18    http_requests_total           - Count of HTTP requests by methods.
    19    http_responses_total          - Count of HTTP responses by methods and status codes.
    20    http_request_duration_seconds - Median, 90th and 99th percentile of request duration.
    21  
    22  Options:
    23   sourceContext             ::= identifier , { "|", identifier }
    24   destinationContext        ::= identifier , { "|", identifier }
    25   sourceEgressContext       ::= identifier , { "|", identifier }
    26   sourceIngressContext      ::= identifier , { "|", identifier }
    27   destinationEgressContext  ::= identifier , { "|", identifier }
    28   destinationIngressContext ::= identifier , { "|", identifier }
    29   labels                    ::= label , { ",", label }
    30   identifier                ::= identity | namespace | pod | pod-name | dns | ip | reserved-identity | workload | workload-name | app
    31   label                     ::= source_ip | source_pod | source_namespace | source_workload | source_workload_kind | source_app | destination_ip | destination_pod | destination_namespace | destination_workload | destination_workload_kind | destination_app | traffic_direction
    32  `
    33  	assert.Equal(t, expected, plugin.HelpText())
    34  }