![JAR search and dependency download from the Maven repository](/logo.png)
com.google.common.util.concurrent.RateLimiter.class Maven / Gradle / Ivy
???? 4 ?
?
1 ? ?
?
1 ?
? ? p ?
1 ? ?
? ?@
1 ? ?
? 1 ? ?
?
? ? ? 1 ?
? ? ?
? ?
1 ?
?
1 ?
1 ?
1 ?
1 ?
? p ?
p ?
1 ?
1 ?
1 ? p ?
? ?
1 ?
1 ?
1 ? ? ? ?
1 ?
? ?
? ? ?
? ? ? SleepingStopwatch InnerClasses stopwatch ALcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch; mutexDoNotUseDirectly Ljava/lang/Object; RuntimeVisibleAnnotations Ljavax/annotation/CheckForNull; create 2(D)Lcom/google/common/util/concurrent/RateLimiter; Code LineNumberTable LocalVariableTable permitsPerSecond D MethodParameters s(DLcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)Lcom/google/common/util/concurrent/RateLimiter; rateLimiter /Lcom/google/common/util/concurrent/RateLimiter; RuntimeInvisibleAnnotations 1Lcom/google/common/annotations/VisibleForTesting; F(DLjava/time/Duration;)Lcom/google/common/util/concurrent/RateLimiter; warmupPeriod Ljava/time/Duration; R(DJLjava/util/concurrent/TimeUnit;)Lcom/google/common/util/concurrent/RateLimiter; J unit Ljava/util/concurrent/TimeUnit;
StackMapTable ?(DJLjava/util/concurrent/TimeUnit;DLcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)Lcom/google/common/util/concurrent/RateLimiter;
coldFactor mutex ()Ljava/lang/Object; this ? D(Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;)V setRate (D)V doSetRate (DJ)V nowMicros getRate ()D doGetRate acquire 8Lcom/google/errorprone/annotations/CanIgnoreReturnValue; (I)D permits I microsToWait reserve (I)J
tryAcquire (Ljava/time/Duration;)Z timeout #(JLjava/util/concurrent/TimeUnit;)Z (I)Z ()Z (ILjava/time/Duration;)Z $(IJLjava/util/concurrent/TimeUnit;)Z
timeoutMicros ?
canAcquire (JJ)Z reserveAndGetWaitLength (IJ)J momentAvailable queryEarliestAvailable (J)J reserveEarliestAvailable toString ()Ljava/lang/String; checkPermits (I)V
SourceFile RateLimiter.java CLcom/google/common/util/concurrent/ElementTypesAreNonnullByDefault; $Lcom/google/common/annotations/Beta; 0Lcom/google/common/annotations/J2ktIncompatible; /Lcom/google/common/annotations/GwtIncompatible; ? ? : B ? @com/google/common/util/concurrent/SmoothRateLimiter$SmoothBursty SmoothBursty U ? W X ? ? ? ? M : J %warmupPeriod must not be negative: %s ? ? ? : O Ccom/google/common/util/concurrent/SmoothRateLimiter$SmoothWarmingUp SmoothWarmingUp U ? 6 7 java/lang/Object U ? ? ? ?com/google/common/util/concurrent/RateLimiter$SleepingStopwatch 4 5 ? ? ? rate must be positive ? ? Q R ? ? Y Z ^ ] _ a e f ? ? ? M ? w { | s t g n ? M ? ? ? q r v w x t ? ? ? RateLimiter[stableRate=%3.1fqps] \ ] ? ? ? ? ? 'Requested permits (%s) must be positive ? ? -com/google/common/util/concurrent/RateLimiter java/lang/Throwable java/util/concurrent/TimeUnit createFromSystemTimer C()Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch; 3com/google/common/util/concurrent/SmoothRateLimiter E(Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;D)V *com/google/common/util/concurrent/Internal toNanosSaturated (Ljava/time/Duration;)J NANOSECONDS $com/google/common/base/Preconditions
checkArgument (ZLjava/lang/String;J)V e(Lcom/google/common/util/concurrent/RateLimiter$SleepingStopwatch;JLjava/util/concurrent/TimeUnit;D)V ()V checkNotNull &(Ljava/lang/Object;)Ljava/lang/Object; java/lang/Double isNaN (D)Z (ZLjava/lang/Object;)V
readMicros ()J sleepMicrosUninterruptibly (J)V SECONDS toMicros MICROSECONDS java/lang/Math max (JJ)J java/util/Locale ROOT Ljava/util/Locale; valueOf (D)Ljava/lang/Double; java/lang/String format K(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String; (ZLjava/lang/String;I)V! 1 4 5 B 6 7 8 9 : ; <