(numTs int, exemplar bool, family string, help string, unit string)
| 86 | } |
| 87 | |
| 88 | func createWriteRequest(numTs int, exemplar bool, family string, help string, unit string) *WriteRequest { |
| 89 | w := &WriteRequest{} |
| 90 | w.Metadata = []*MetricMetadata{ |
| 91 | { |
| 92 | MetricFamilyName: family, |
| 93 | Help: help, |
| 94 | Unit: unit, |
| 95 | }, |
| 96 | } |
| 97 | |
| 98 | for i := range numTs { |
| 99 | w.Timeseries = append(w.Timeseries, PreallocTimeseries{ |
| 100 | TimeSeries: &TimeSeries{ |
| 101 | Labels: []LabelAdapter{ |
| 102 | { |
| 103 | Name: fmt.Sprintf("Name-%v", i), |
| 104 | Value: fmt.Sprintf("Value-%v", i), |
| 105 | }, |
| 106 | }, |
| 107 | }, |
| 108 | }) |
| 109 | |
| 110 | if exemplar { |
| 111 | w.Timeseries[i].Exemplars = []Exemplar{ |
| 112 | { |
| 113 | Labels: []LabelAdapter{ |
| 114 | { |
| 115 | Name: fmt.Sprintf("Ex-Name-%v", i), |
| 116 | Value: fmt.Sprintf("Ex-Value-%v", i), |
| 117 | }, |
| 118 | }, |
| 119 | }, |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | return w |
| 125 | } |
no outgoing calls
no test coverage detected