Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 560 for sortby (0.1 sec)

  1. src/cmd/trace/goroutines.go

    		}
    
    		// Sort.
    		sortBy := r.FormValue("sortby")
    		if _, ok := validNonOverlappingStats[sortBy]; ok {
    			slices.SortFunc(goroutines, func(a, b goroutine) int {
    				return cmp.Compare(b.NonOverlappingStats[sortBy], a.NonOverlappingStats[sortBy])
    			})
    		} else {
    			// Sort by total time by default.
    			slices.SortFunc(goroutines, func(a, b goroutine) int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  2. src/cmd/trace/regions.go

    					maxTotal = r.TotalTime
    				}
    			}
    		}
    
    		// Sort.
    		sortBy := r.FormValue("sortby")
    		if _, ok := validNonOverlappingStats[sortBy]; ok {
    			slices.SortFunc(regions, func(a, b region) int {
    				return cmp.Compare(b.NonOverlappingStats[sortBy], a.NonOverlappingStats[sortBy])
    			})
    		} else {
    			// Sort by total time by default.
    			slices.SortFunc(regions, func(a, b region) int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 14.3K bytes
    - Viewed (0)
  3. istioctl/pkg/util/handlers/handlers.go

    	}
    	// We need to pass in a sorter, and the one used by `kubectl logs` is good enough.
    	sortBy := func(pods []*corev1.Pod) sort.Interface { return podutils.ByLogging(pods) }
    	timeout := 2 * time.Second
    	if getFirstPodFunc == nil {
    		getFirstPodFunc = polymorphichelpers.GetFirstPod
    	}
    	pod, _, err := getFirstPodFunc(client, namespace, selector, timeout, sortBy)
    	if err != nil {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Feb 06 15:01:41 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  4. pkg/kube/krt/join_test.go

    	c1.Set(&Named{"c1", "b"})
    	assert.EventuallyEqual(t, last.Load, "c1/b")
    	// ordered by c1, c2, c3
    	sortf := func(a Named) string {
    		return a.ResourceName()
    	}
    	assert.Equal(
    		t,
    		slices.SortBy(j.List(), sortf),
    		slices.SortBy([]Named{
    			{"c1", "b"},
    			{"c2", "a"},
    			{"c3", "a"},
    		}, sortf),
    	)
    }
    
    func TestCollectionJoin(t *testing.T) {
    	c := kube.NewFakeClient()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 09 19:55:53 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  5. pkg/kube/krt/index_test.go

    		pods := krt.Fetch(ctx, SimplePods, krt.FilterIndex(IPIndex, "1.2.3.5"))
    		names := slices.Sort(slices.Map(pods, SimplePod.ResourceName))
    		return ptr.Of(strings.Join(names, ","))
    	})
    	Collection.AsCollection().Synced().WaitUntilSynced(stop)
    	fetchSorted := func(ip string) []SimplePod {
    		return slices.SortBy(IPIndex.Lookup(ip), func(t SimplePod) string {
    			return t.ResourceName()
    		})
    	}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Apr 09 19:55:53 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  6. pkg/slices/slices_test.go

    			b.StopTimer()
    			ss := makeRandomStructs(N)
    			b.StartTimer()
    			SortStableFunc(ss, cmpFunc)
    		}
    	})
    	b.Run("SortBy", func(b *testing.B) {
    		cmpFunc := func(a *myStruct) int { return a.n }
    		for i := 0; i < b.N; i++ {
    			b.StopTimer()
    			ss := makeRandomStructs(N)
    			b.StartTimer()
    			SortBy(ss, cmpFunc)
    		}
    	})
    }
    
    func ExampleSort() {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri May 10 23:33:56 UTC 2024
    - 18.2K bytes
    - Viewed (0)
  7. cni/pkg/repair/repair_test.go

    			go c.Run(stop)
    			kube.WaitForCacheSync("test", stop, c.queue.HasSynced)
    
    			assert.EventuallyEqual(t, func() map[string]string {
    				havePods := c.pods.List(metav1.NamespaceAll, klabels.Everything())
    				slices.SortBy(havePods, func(a *corev1.Pod) string {
    					return a.Name
    				})
    				return makePodLabelMap(havePods)
    			}, tt.wantLabels)
    			if tt.wantCount > 0 {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 24 03:31:28 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  8. pkg/kube/krt/informer_test.go

    	cmt.Update(cmA2)
    	tt.WaitOrdered("update/ns/a")
    	assert.Equal(t, ConfigMaps.List(), []*corev1.ConfigMap{cmA2})
    
    	cmt.Create(cmB)
    	tt.WaitOrdered("add/ns/b")
    	assert.Equal(t, slices.SortBy(ConfigMaps.List(), func(a *corev1.ConfigMap) string { return a.Name }), []*corev1.ConfigMap{cmA2, cmB})
    
    	assert.Equal(t, ConfigMaps.GetKey("ns/b"), &cmB)
    	assert.Equal(t, ConfigMaps.GetKey("ns/a"), &cmA2)
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 17 16:38:40 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  9. pkg/slices/slices.go

    	if len(x) <= 1 {
    		return x
    	}
    	slices.SortStableFunc(x, less)
    	return x
    }
    
    // SortBy is a helper to sort a slice by some value. Typically, this would be sorting a struct
    // by a single field. If you need to have multiple fields, see the ExampleSort.
    func SortBy[E any, A constraints.Ordered](x []E, extract func(a E) A) []E {
    	if len(x) <= 1 {
    		return x
    	}
    	SortFunc(x, func(a, b E) int {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 15 06:28:11 UTC 2024
    - 7.9K bytes
    - Viewed (0)
  10. analysis/analysis-api-impl-base/tests/org/jetbrains/kotlin/analysis/api/impl/base/test/cases/components/scopeProvider/TestScopeRenderer.kt

                            withIndent { appendLine(it) }
                        }
                    }
                }
            }
    
            scope.getPackageSymbols()
                .toMutableList()
                .apply { sortBy { it.fqName.asString() } }
                .renderAll("packages") { prettyRenderPackage(it) }
            scope.getClassifierSymbols().toList().renderAll("classifiers") { prettyRenderDeclaration(it) }
    Registered: Wed Jun 12 09:53:16 UTC 2024
    - Last Modified: Tue Jun 04 08:26:19 UTC 2024
    - 7.3K bytes
    - Viewed (0)
Back to top