MCPcopy Index your code
hub / github.com/coder/coder / NewFetcher

Function NewFetcher

agent/proto/resourcesmonitor/fetcher.go:27–34  ·  view source on GitHub ↗

nolint:revive

(f Statter)

Source from the content-addressed store, hash-verified

25
26//nolint:revive
27func NewFetcher(f Statter) (*fetcher, error) {
28 isContainerized, err := f.IsContainerized()
29 if err != nil {
30 return nil, xerrors.Errorf("check is containerized: %w", err)
31 }
32
33 return &fetcher{f, isContainerized}, nil
34}
35
36func (f *fetcher) FetchMemory() (total int64, used int64, err error) {
37 var mem *clistat.Result

Callers 1

TestFetchMemoryFunction · 0.92

Calls 2

IsContainerizedMethod · 0.65
ErrorfMethod · 0.45

Tested by 1

TestFetchMemoryFunction · 0.74