File tree Expand file tree Collapse file tree 1 file changed +1
-23
lines changed
staging/src/k8s.io/component-base/metrics/testutil Expand file tree Collapse file tree 1 file changed +1
-23
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ func ParseMetrics(data string, output *Metrics) error {
86
86
continue
87
87
}
88
88
for _ , metric := range v {
89
- name := string (metric .Metric [model . MetricNameLabel ])
89
+ name := string (metric .Metric [MetricNameLabel ])
90
90
(* output )[name ] = append ((* output )[name ], metric )
91
91
}
92
92
}
@@ -101,28 +101,6 @@ func TextToMetricFamilies(in io.Reader) (map[string]*dto.MetricFamily, error) {
101
101
return textParser .TextToMetricFamilies (in )
102
102
}
103
103
104
- // ExtractMetricSamples parses the prometheus metric samples from the input string.
105
- func ExtractMetricSamples (metricsBlob string ) ([]* model.Sample , error ) {
106
- dec := expfmt .NewDecoder (strings .NewReader (metricsBlob ), expfmt .FmtText )
107
- decoder := expfmt.SampleDecoder {
108
- Dec : dec ,
109
- Opts : & expfmt.DecodeOptions {},
110
- }
111
-
112
- var samples []* model.Sample
113
- for {
114
- var v model.Vector
115
- if err := decoder .Decode (& v ); err != nil {
116
- if err == io .EOF {
117
- // Expected loop termination condition.
118
- return samples , nil
119
- }
120
- return nil , err
121
- }
122
- samples = append (samples , v ... )
123
- }
124
- }
125
-
126
104
// PrintSample returns formatted representation of metric Sample
127
105
func PrintSample (sample * model.Sample ) string {
128
106
buf := make ([]string , 0 )
You can’t perform that action at this time.
0 commit comments