MCPcopy Create free account
hub / github.com/deepflowio/deepflow / splitData

Method splitData

server/controller/prometheus/label.go:227–243  ·  view source on GitHub ↗
(req *trident.PrometheusLabelRequest)

Source from the content-addressed store, hash-verified

225}
226
227func (s *LabelSynchronizer) splitData(req *trident.PrometheusLabelRequest) *dataToEncode {
228 toEncode := newDataToEncode(s.cache)
229 for _, m := range req.GetRequestLabels() {
230 mn := m.GetMetricName()
231 toEncode.tryAppendMetricName(mn)
232 for _, l := range m.GetLabels() {
233 ln := l.GetName()
234 lv := l.GetValue()
235 toEncode.tryAppendLabelName(ln)
236 toEncode.tryAppendLabelValue(lv)
237 toEncode.tryAppendLabel(ln, lv)
238 toEncode.tryAppendMetricAPPLabelLayout(mn, ln)
239 }
240 }
241
242 return toEncode
243}
244
245func (s *LabelSynchronizer) generateSyncRequest(toEncode *dataToEncode) *controller.SyncPrometheusRequest {
246 return &controller.SyncPrometheusRequest{

Callers 1

assembleMethod · 0.95

Calls 9

newDataToEncodeFunction · 0.85
tryAppendMetricNameMethod · 0.80
tryAppendLabelNameMethod · 0.80
tryAppendLabelValueMethod · 0.80
tryAppendLabelMethod · 0.80
GetLabelsMethod · 0.65
GetNameMethod · 0.65
GetValueMethod · 0.45

Tested by

no test coverage detected