Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for sumDuration (0.15 sec)

  1. staging/src/k8s.io/apiserver/pkg/endpoints/request/webhook_duration.go

    See the License for the specific language governing permissions and
    limitations under the License.
    */
    
    package request
    
    import (
    	"context"
    	"sync"
    	"time"
    
    	"k8s.io/utils/clock"
    )
    
    func sumDuration(d1 time.Duration, d2 time.Duration) time.Duration {
    	return d1 + d2
    }
    
    func maxDuration(d1 time.Duration, d2 time.Duration) time.Duration {
    	if d1 > d2 {
    		return d1
    	}
    	return d2
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 13 22:15:37 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/endpoints/request/webhook_duration_test.go

    )
    
    func TestLatencyTrackersFrom(t *testing.T) {
    	type testCase struct {
    		Durations    []time.Duration
    		SumDurations time.Duration
    		MaxDuration  time.Duration
    	}
    	tc := testCase{
    		Durations:    []time.Duration{100, 200, 300, 200, 400, 300, 100},
    		SumDurations: 1600,
    		MaxDuration:  400,
    	}
    	t.Run("TestLatencyTrackersFrom", func(t *testing.T) {
    		parent := context.TODO()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 09:15:20 UTC 2023
    - 2.4K bytes
    - Viewed (0)
Back to top