(req *controller.SyncPrometheusRequest)
| 77 | } |
| 78 | |
| 79 | func (e *Encoder) Encode(req *controller.SyncPrometheusRequest) (*controller.SyncPrometheusResponse, error) { |
| 80 | resp := new(controller.SyncPrometheusResponse) |
| 81 | eg1RunAhead := &errgroup.Group{} |
| 82 | common.AppendErrGroup(eg1RunAhead, e.encodeMetricName, resp, req.GetMetricNames()) |
| 83 | common.AppendErrGroup(eg1RunAhead, e.encodeLabelName, resp, req.GetLabelNames()) |
| 84 | common.AppendErrGroup(eg1RunAhead, e.encodeLabelValue, resp, req.GetLabelValues()) |
| 85 | err := eg1RunAhead.Wait() |
| 86 | if err != nil { |
| 87 | return resp, err |
| 88 | } |
| 89 | eg2RunAhead := &errgroup.Group{} |
| 90 | common.AppendErrGroup(eg2RunAhead, e.encodeLabel, resp, req.GetLabels()) |
| 91 | common.AppendErrGroup(eg2RunAhead, e.encodeLabelIndex, resp, req.GetMetricAppLabelLayouts()) |
| 92 | err = eg2RunAhead.Wait() |
| 93 | return resp, err |
| 94 | } |
| 95 | |
| 96 | func (e *Encoder) encodeMetricName(args ...interface{}) error { |
| 97 | resp := args[0].(*controller.SyncPrometheusResponse) |
no test coverage detected