Skip to content

Commit

Permalink
move cgroup and iruntime utils from memory_limiter to internal foler (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mxiamxia authored Jun 16, 2021
1 parent 05f16c5 commit b06ffe5
Show file tree
Hide file tree
Showing 30 changed files with 5 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ func NewCGroupsForCurrentProcess() (CGroups, error) {
// It is a result of `memory.limit_in_bytes`. If the value of
// `memory.limit_in_bytes` was not set (-1), the method returns `(-1, false, nil)`.
func (cg CGroups) MemoryQuota() (int64, bool, error) {
cpuCGroup, exists := cg[_cgroupSubsysMemory]
memCGroup, exists := cg[_cgroupSubsysMemory]
if !exists {
return -1, false, nil
}

memLimitBytes, err := cpuCGroup.readInt(_cgroupMemoryLimitBytes)
memLimitBytes, err := memCGroup.readInt(_cgroupMemoryLimitBytes)
if defined := memLimitBytes > 0; err != nil || !defined {
return -1, defined, err
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package iruntime

import "go.opentelemetry.io/collector/processor/memorylimiter/internal/cgroups"
import "go.opentelemetry.io/collector/internal/cgroups"

// TotalMemory returns total available memory.
// This implementation is meant for linux and uses cgroups to determine available memory.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion processor/memorylimiter/memorylimiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

"go.opentelemetry.io/collector/config/configtelemetry"
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/internal/iruntime"
"go.opentelemetry.io/collector/obsreport"
"go.opentelemetry.io/collector/processor/memorylimiter/internal/iruntime"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion processor/memorylimiter/memorylimiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/consumer/pdata"
"go.opentelemetry.io/collector/internal/iruntime"
"go.opentelemetry.io/collector/obsreport"
"go.opentelemetry.io/collector/processor/memorylimiter/internal/iruntime"
"go.opentelemetry.io/collector/processor/processorhelper"
)

Expand Down

0 comments on commit b06ffe5

Please sign in to comment.