Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 57 for newResource (0.27 sec)

  1. cmd/license-update.go

    )
    
    // initlicenseUpdateJob start the periodic license update job in the background.
    func initLicenseUpdateJob(ctx context.Context, objAPI ObjectLayer) {
    	go func() {
    		r := rand.New(rand.NewSource(time.Now().UnixNano()))
    		// Leader node (that successfully acquires the lock inside licenceUpdaterLoop)
    		// will keep performing the license update. If the leader goes down for some
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 04 12:04:40 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. pkg/api/testing/conversion_test.go

    	"k8s.io/kubernetes/pkg/api/legacyscheme"
    	api "k8s.io/kubernetes/pkg/apis/core"
    )
    
    func BenchmarkPodConversion(b *testing.B) {
    	apiObjectFuzzer := fuzzer.FuzzerFor(FuzzerFuncs, rand.NewSource(benchmarkSeed), legacyscheme.Codecs)
    	items := make([]api.Pod, 4)
    	for i := range items {
    		apiObjectFuzzer.Fuzz(&items[i])
    		items[i].Spec.InitContainers = nil
    		items[i].Status.InitContainerStatuses = nil
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Oct 30 06:49:09 UTC 2021
    - 3.9K bytes
    - Viewed (0)
  3. pkg/test/loadbalancersim/loadbalancer/leastrequest.go

    }
    
    // nolint: gosec
    // Test only code
    func newUnweightedLeastRequest(conn *weightedConnections) network.Connection {
    	return &unweightedLeastRequest{
    		weightedConnections: conn,
    		r:                   rand.New(rand.NewSource(time.Now().UnixNano())),
    	}
    }
    
    func (lb *unweightedLeastRequest) pick2() (*WeightedConnection, *WeightedConnection) {
    	numConnections := len(lb.conns)
    	index1 := lb.r.Intn(numConnections)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Nov 14 20:23:34 UTC 2022
    - 3.4K bytes
    - Viewed (0)
  4. src/go/doc/comment/wrap_test.go

    func TestWrap(t *testing.T) {
    	if *wrapSeed == 0 {
    		*wrapSeed = time.Now().UnixNano()
    	}
    	t.Logf("-wrapseed=%#x\n", *wrapSeed)
    	r := rand.New(rand.NewSource(*wrapSeed))
    
    	// Generate words of random length.
    	s := "1234567890αβcdefghijklmnopqrstuvwxyz"
    	sN := utf8.RuneCountInString(s)
    	var words []string
    	for i := 0; i < 100; i++ {
    		n := 1 + r.Intn(sN-1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:31:45 UTC 2022
    - 3.7K bytes
    - Viewed (0)
  5. src/runtime/lfstack_test.go

    	for i := 0; i < K; i++ {
    		sum += i
    		node := allocMyNode(i)
    		LFStackPush(stacks[i%2], fromMyNode(node))
    	}
    	c := make(chan bool, P)
    	for p := 0; p < P; p++ {
    		go func() {
    			r := rand.New(rand.NewSource(rand.Int63()))
    			// Pop a node from a random stack, then push it onto a random stack.
    			for i := 0; i < N; i++ {
    				node := toMyNode(LFStackPop(stacks[r.Intn(2)]))
    				if node != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 17 23:12:04 UTC 2022
    - 2.7K bytes
    - Viewed (0)
  6. internal/s3select/select_benchmark_test.go

    	"time"
    
    	humanize "github.com/dustin/go-humanize"
    )
    
    const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    
    func newRandString(length int) string {
    	randSrc := rand.New(rand.NewSource(time.Now().UnixNano()))
    
    	b := make([]byte, length)
    	for i := range b {
    		b[i] = charset[randSrc.Intn(len(charset))]
    	}
    	return string(b)
    }
    
    func genSampleCSVData(count int) []byte {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 14 13:54:47 UTC 2022
    - 5K bytes
    - Viewed (0)
  7. src/math/rand/example_test.go

    func Example_rand() {
    	// Create and seed the generator.
    	// Typically a non-fixed seed should be used, such as time.Now().UnixNano().
    	// Using a fixed seed will produce the same output on every run.
    	r := rand.New(rand.NewSource(99))
    
    	// The tabwriter here helps us generate aligned output.
    	w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0)
    	defer w.Flush()
    	show := func(name string, v1, v2, v3 any) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 16:24:57 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  8. src/os/writeto_linux_test.go

    		t.Fatalf("failed to create temporary file: %v", err)
    	}
    	t.Cleanup(func() {
    		f.Close()
    	})
    
    	randSeed := time.Now().Unix()
    	t.Logf("random data seed: %d\n", randSeed)
    	prng := rand.New(rand.NewSource(randSeed))
    	data := make([]byte, size)
    	prng.Read(data)
    	if _, err := f.Write(data); err != nil {
    		t.Fatalf("failed to create and feed the file: %v", err)
    	}
    	if err := f.Sync(); err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 26 18:12:56 UTC 2024
    - 4K bytes
    - Viewed (0)
  9. src/internal/poll/fd_mutex_test.go

    	var mu XFDMutex
    	var readState [2]uint64
    	var writeState [2]uint64
    	for p := 0; p < P; p++ {
    		go func() {
    			defer func() {
    				done <- !t.Failed()
    			}()
    			r := rand.New(rand.NewSource(rand.Int63()))
    			for i := 0; i < N; i++ {
    				switch r.Intn(3) {
    				case 0:
    					if !mu.Incref() {
    						t.Error("broken")
    						return
    					}
    					if mu.Decref() {
    						t.Error("broken")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Oct 08 03:57:40 UTC 2022
    - 4K bytes
    - Viewed (0)
  10. internal/lsync/lrwmutex.go

    // timing randomized back-off algorithm to try again until successful
    func (lm *LRWMutex) lockLoop(ctx context.Context, id, source string, timeout time.Duration, isWriteLock bool) (locked bool) {
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    
    	retryCtx, cancel := context.WithTimeout(ctx, timeout)
    	defer cancel()
    
    	for {
    		select {
    		case <-retryCtx.Done():
    			// Caller context canceled or we timedout,
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 4.8K bytes
    - Viewed (0)
Back to top