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

Function parsebytes

pkg/chunk/cache/fifo_cache.go:54–63  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

52}
53
54func parsebytes(s string) (uint64, error) {
55 if len(s) == 0 {
56 return 0, nil
57 }
58 bytes, err := humanize.ParseBytes(s)
59 if err != nil {
60 return 0, errors.Wrap(err, "invalid FifoCache config")
61 }
62 return bytes, nil
63}
64
65// FifoCache is a simple string -> interface{} cache which uses a fifo slide to
66// manage evictions. O(1) inserts and updates, O(1) gets.

Callers 3

ValidateMethod · 0.85
NewFifoCacheFunction · 0.85
TestBytesParsingFunction · 0.85

Calls 1

WrapMethod · 0.65

Tested by 1

TestBytesParsingFunction · 0.68