From 6e2cb00008cbf09e556b00f87603797fcaa47e09 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 16 Apr 2018 05:37:14 -0700 Subject: Depenancy upgrades and movign to dep. (#8630) --- vendor/gopkg.in/throttled/throttled.v2/rate.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'vendor/gopkg.in/throttled/throttled.v2/rate.go') diff --git a/vendor/gopkg.in/throttled/throttled.v2/rate.go b/vendor/gopkg.in/throttled/throttled.v2/rate.go index 649287beb..8c11cdb47 100644 --- a/vendor/gopkg.in/throttled/throttled.v2/rate.go +++ b/vendor/gopkg.in/throttled/throttled.v2/rate.go @@ -84,18 +84,17 @@ type Rate struct { // RateQuota describes the number of requests allowed per time period. // MaxRate specified the maximum sustained rate of requests and must -// be greater than zero. MaxBurst defines the number of requests that +// be greater than zero. MaxBurst defines the number of requests that // will be allowed to exceed the rate in a single burst and must be // greater than or equal to zero. // // Rate{PerSec(1), 0} would mean that after each request, no more -// requests will be permitted for that client for one second. -// Rate{PerSec(2), 0} permits one request per 0.5 seconds rather than -// two requests in one second. In practice, you probably want to set -// MaxBurst >0 to provide some flexibility to clients that only need -// to make a handful of requests. In fact a MaxBurst of zero will -// *never* permit a request with a quantity greater than one because -// it will immediately exceed the limit. +// requests will be permitted for that client for one second. In +// practice, you probably want to set MaxBurst >0 to provide some +// flexibility to clients that only need to make a handful of +// requests. In fact a MaxBurst of zero will *never* permit a request +// with a quantity greater than one because it will immediately exceed +// the limit. type RateQuota struct { MaxRate Rate MaxBurst int @@ -119,12 +118,10 @@ func PerDay(n int) Rate { return Rate{24 * time.Hour / time.Duration(n), n} } // as for limiting the number of bytes uploaded. type GCRARateLimiter struct { limit int - // Think of the DVT as our flexibility: // How far can you deviate from the nominal equally spaced schedule? // If you like leaky buckets, think about it as the size of your bucket. delayVariationTolerance time.Duration - // Think of the emission interval as the time between events // in the nominal equally spaced schedule. If you like leaky buckets, // think of it as how frequently the bucket leaks one unit. -- cgit v1.2.3-1-g7c22