MCPcopy
hub / github.com/prometheus/prometheus / NewEncoder

Function NewEncoder

tsdb/compression/compression.go:48–56  ·  view source on GitHub ↗

NewEncoder creates a new Encoder. Returns an error if the zstd encoder cannot be initialized.

()

Source from the content-addressed store, hash-verified

46// NewEncoder creates a new Encoder. Returns an error if the zstd encoder cannot
47// be initialized.
48func NewEncoder() (*Encoder, error) {
49 e := &Encoder{}
50 w, err := zstd.NewWriter(nil)
51 if err != nil {
52 return nil, err
53 }
54 e.w = w
55 return e, nil
56}
57
58// Encode returns the encoded form of src for the given compression type. It also
59// returns the indicator if the compression was performed. Encode may skip

Callers 7

TestEncodeDecodeFunction · 0.92
BenchmarkEncode_SamplesFunction · 0.92
BenchmarkDecode_SamplesFunction · 0.92

Calls

no outgoing calls

Tested by 7

TestEncodeDecodeFunction · 0.74
BenchmarkEncode_SamplesFunction · 0.74
BenchmarkDecode_SamplesFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…