Search in sources :

Example 1 with TokenBucket

use of com.android.internal.util.TokenBucket in project platform_frameworks_base by android.

the class IpConnectivityMetrics method makeRateLimitingBuckets.

private static ArrayMap<Class<?>, TokenBucket> makeRateLimitingBuckets() {
    ArrayMap<Class<?>, TokenBucket> map = new ArrayMap<>();
    // one token every minute, 50 tokens max: burst of ~50 events every hour.
    map.put(ApfProgramEvent.class, new TokenBucket((int) DateUtils.MINUTE_IN_MILLIS, 50));
    return map;
}
Also used : TokenBucket(com.android.internal.util.TokenBucket) ArrayMap(android.util.ArrayMap)

Example 2 with TokenBucket

use of com.android.internal.util.TokenBucket in project android_frameworks_base by DirtyUnicorns.

the class IpConnectivityMetrics method makeRateLimitingBuckets.

private static ArrayMap<Class<?>, TokenBucket> makeRateLimitingBuckets() {
    ArrayMap<Class<?>, TokenBucket> map = new ArrayMap<>();
    // one token every minute, 50 tokens max: burst of ~50 events every hour.
    map.put(ApfProgramEvent.class, new TokenBucket((int) DateUtils.MINUTE_IN_MILLIS, 50));
    return map;
}
Also used : TokenBucket(com.android.internal.util.TokenBucket) ArrayMap(android.util.ArrayMap)

Example 3 with TokenBucket

use of com.android.internal.util.TokenBucket in project android_frameworks_base by ResurrectionRemix.

the class IpConnectivityMetrics method makeRateLimitingBuckets.

private static ArrayMap<Class<?>, TokenBucket> makeRateLimitingBuckets() {
    ArrayMap<Class<?>, TokenBucket> map = new ArrayMap<>();
    // one token every minute, 50 tokens max: burst of ~50 events every hour.
    map.put(ApfProgramEvent.class, new TokenBucket((int) DateUtils.MINUTE_IN_MILLIS, 50));
    return map;
}
Also used : TokenBucket(com.android.internal.util.TokenBucket) ArrayMap(android.util.ArrayMap)

Example 4 with TokenBucket

use of com.android.internal.util.TokenBucket in project android_frameworks_base by crdroidandroid.

the class IpConnectivityMetrics method makeRateLimitingBuckets.

private static ArrayMap<Class<?>, TokenBucket> makeRateLimitingBuckets() {
    ArrayMap<Class<?>, TokenBucket> map = new ArrayMap<>();
    // one token every minute, 50 tokens max: burst of ~50 events every hour.
    map.put(ApfProgramEvent.class, new TokenBucket((int) DateUtils.MINUTE_IN_MILLIS, 50));
    return map;
}
Also used : TokenBucket(com.android.internal.util.TokenBucket) ArrayMap(android.util.ArrayMap)

Example 5 with TokenBucket

use of com.android.internal.util.TokenBucket in project android_frameworks_base by AOSPA.

the class IpConnectivityMetrics method makeRateLimitingBuckets.

private static ArrayMap<Class<?>, TokenBucket> makeRateLimitingBuckets() {
    ArrayMap<Class<?>, TokenBucket> map = new ArrayMap<>();
    // one token every minute, 50 tokens max: burst of ~50 events every hour.
    map.put(ApfProgramEvent.class, new TokenBucket((int) DateUtils.MINUTE_IN_MILLIS, 50));
    return map;
}
Also used : TokenBucket(com.android.internal.util.TokenBucket) ArrayMap(android.util.ArrayMap)

Aggregations

ArrayMap (android.util.ArrayMap)5 TokenBucket (com.android.internal.util.TokenBucket)5