Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for applyOOMScoreAdj (0.15 sec)

  1. pkg/util/oom/oom_linux.go

    	"strconv"
    	"time"
    
    	cmutil "k8s.io/kubernetes/pkg/kubelet/cm/util"
    
    	"k8s.io/klog/v2"
    )
    
    func NewOOMAdjuster() *OOMAdjuster {
    	oomAdjuster := &OOMAdjuster{
    		pidLister:        getPids,
    		ApplyOOMScoreAdj: applyOOMScoreAdj,
    	}
    	oomAdjuster.ApplyOOMScoreAdjContainer = oomAdjuster.applyOOMScoreAdjContainer
    	return oomAdjuster
    }
    
    func getPids(cgroupName string) ([]int, error) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 20 07:13:28 UTC 2022
    - 4K bytes
    - Viewed (0)
  2. pkg/util/oom/oom_linux_test.go

    func applyOOMScoreAdjContainerTester(pidListSequence [][]int, maxTries int, appliedPids []int, expectedError bool, t *testing.T) {
    	pidOOMs := make(map[int]bool)
    
    	// Mock ApplyOOMScoreAdj and pidLister.
    	oomAdjuster := NewOOMAdjuster()
    	oomAdjuster.ApplyOOMScoreAdj = func(pid int, oomScoreAdj int) error {
    		pidOOMs[pid] = true
    		return nil
    	}
    	oomAdjuster.pidLister = sequenceToPidLister(pidListSequence)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 24 19:47:49 UTC 2021
    - 3.3K bytes
    - Viewed (0)
  3. pkg/util/oom/oom_fake.go

    package oom
    
    type FakeOOMAdjuster struct{}
    
    func NewFakeOOMAdjuster() *OOMAdjuster {
    	return &OOMAdjuster{
    		pidLister:                 func(cgroupName string) ([]int, error) { return make([]int, 0), nil },
    		ApplyOOMScoreAdj:          fakeApplyOOMScoreAdj,
    		ApplyOOMScoreAdjContainer: fakeApplyOOMScoreAdjContainer,
    	}
    }
    
    func fakeApplyOOMScoreAdj(pid int, oomScoreAdj int) error {
    	return nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 30 00:47:36 UTC 2016
    - 1K bytes
    - Viewed (0)
  4. pkg/util/oom/oom_unsupported.go

    */
    
    package oom
    
    import (
    	"errors"
    )
    
    var unsupportedErr = errors.New("setting OOM scores is unsupported in this build")
    
    func NewOOMAdjuster() *OOMAdjuster {
    	return &OOMAdjuster{
    		ApplyOOMScoreAdj:          unsupportedApplyOOMScoreAdj,
    		ApplyOOMScoreAdjContainer: unsupportedApplyOOMScoreAdjContainer,
    	}
    }
    
    func unsupportedApplyOOMScoreAdj(pid int, oomScoreAdj int) error {
    	return unsupportedErr
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Aug 24 19:47:49 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  5. pkg/util/oom/oom.go

    // applying OOM score in tests.
    // TODO: make this an interface, and inject a mock ioutil struct for testing.
    type OOMAdjuster struct {
    	pidLister                 func(cgroupName string) ([]int, error)
    	ApplyOOMScoreAdj          func(pid int, oomScoreAdj int) error
    	ApplyOOMScoreAdjContainer func(cgroupName string, oomScoreAdj, maxTries int) error
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jun 30 00:47:36 UTC 2016
    - 1K bytes
    - Viewed (0)
Back to top