google / google/cadvisor

`cadvisor/utils/oomparser` - Add constructor to (optionally) allow streaming of current+new OOMs only.

Open
#3,715 2 comments 0 reactions 0 assignees View on GitHub
lifecycle/stale
Dominant language
Go
Stars
19.4k
Forks
2.5k
Avg merge
9h 7m
Merged PRs (30d)
1

Description

### Summary

`cadvisor/utils/oomparser` currently returns an `OomParser` object with the underlying reader pointing to the head of `/dev/kmsg`. This returns _all_ OOM events that are currently available in the kmsg buffer.

While this is desirable in certain cases, a user may wish to only subscribe to _new_ OOM events that are occurring. The underlying reader supports a [SeekEnd](https://github.com/euank/go-kmsg-parser/blob/v3.0.0/kmsgparser/kmsgparser.go#L122-L125) function that fast-forwards the offset to the end of the buffer.

This is a request to add a constructor that returns the `OomParser` object with the offset moved to the end of the kmsg queue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.