MCPcopy Index your code
hub / github.com/deepflowio/deepflow / Encode

Method Encode

server/controller/prometheus/encoder/encoder.go:79–94  ·  view source on GitHub ↗
(req *controller.SyncPrometheusRequest)

Source from the content-addressed store, hash-verified

77}
78
79func (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
96func (e *Encoder) encodeMetricName(args ...interface{}) error {
97 resp := args[0].(*controller.SyncPrometheusResponse)

Callers 15

mapToYamlFunction · 0.95
dictToStringMethod · 0.95
writeFunction · 0.95
GobEncodeMethod · 0.95
encodeBufferFunction · 0.95
sendCmdFunction · 0.95
SendToServerFunction · 0.95
SendToClientFunction · 0.95
ToBytesMethod · 0.95
sendToDropletCtlFunction · 0.95
debugSendMsgFunction · 0.95
sendDebugMethod · 0.95

Calls 1

GetLabelsMethod · 0.65

Tested by

no test coverage detected