MCPcopy Create free account
hub / github.com/cortexproject/cortex / Write

Method Write

integration/e2e/service.go:518–533  ·  view source on GitHub ↗
(p []byte)

Source from the content-addressed store, hash-verified

516}
517
518func (w *LinePrefixLogger) Write(p []byte) (n int, err error) {
519 for line := range strings.SplitSeq(string(p), "\n") {
520 // Skip empty lines
521 line = strings.TrimSpace(line)
522 if line == "" {
523 continue
524 }
525
526 // Write the prefix + line to the wrapped writer
527 if err := w.logger.Log(w.prefix + line); err != nil {
528 return 0, err
529 }
530 }
531
532 return len(p), nil
533}
534
535// HTTPService represents opinionated microservice with at least HTTP port that as mandatory requirement,
536// serves metrics.

Callers 6

PushV2Method · 0.45
TestWaitSumMetricFunction · 0.45
TestWaitSumMetric_NanFunction · 0.45
LogMethod · 0.45
CreateNHBlockFunction · 0.45
CreateBlockFunction · 0.45

Calls 1

LogMethod · 0.45

Tested by 2

TestWaitSumMetricFunction · 0.36
TestWaitSumMetric_NanFunction · 0.36