mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
This PR only moves all the internal code used by internal/memorylimiter under the same directory, next PR will extract that in a different module to limit dependencies. Signed-off-by: Bogdan Drutu <[email protected]>
16 lines
402 B
Go
16 lines
402 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package iruntime // import "go.opentelemetry.io/collector/internal/memorylimiter/iruntime"
|
|
|
|
import (
|
|
"github.com/shirou/gopsutil/v4/mem"
|
|
)
|
|
|
|
// readMemInfo returns the total memory
|
|
// supports in linux, darwin and windows
|
|
func readMemInfo() (uint64, error) {
|
|
vmStat, err := mem.VirtualMemory()
|
|
return vmStat.Total, err
|
|
}
|