Package freenet.support

Examples of freenet.support.TokenBucket


    localSSKFetchTimeAverageBulk = new TrivialRunningAverage();

    chkSuccessRatesByLocation = new Histogram2(10, 1.0);

    requestOutputThrottle =
      new TokenBucket(Math.max(obwLimit*60, 32768*20), SECONDS.toNanos(1) / obwLimit, 0);
    requestInputThrottle =
      new TokenBucket(Math.max(ibwLimit*60, 32768*20), SECONDS.toNanos(1) / ibwLimit, 0);

    double nodeLoc=node.lm.getLocation();
    this.avgCacheCHKLocation   = new DecayingKeyspaceAverage(nodeLoc, 10000, throttleFS == null ? null : throttleFS.subset("AverageCacheCHKLocation"));
    this.avgStoreCHKLocation   = new DecayingKeyspaceAverage(nodeLoc, 10000, throttleFS == null ? null : throttleFS.subset("AverageStoreCHKLocation"));
    this.avgSlashdotCacheCHKLocation = new DecayingKeyspaceAverage(nodeLoc, 10000, throttleFS == null ? null : throttleFS.subset("AverageSlashdotCacheCHKLocation"));
View Full Code Here


    int bucketSize = obwLimit/2;
    // Must have at least space for ONE PACKET.
    // FIXME: make compatible with alternate transports.
    bucketSize = Math.max(bucketSize, 2048);
    try {
    outputThrottle = new TokenBucket(bucketSize, SECONDS.toNanos(1) / obwLimit, obwLimit/2);
    } catch (IllegalArgumentException e) {
      throw new NodeInitException(NodeInitException.EXIT_BAD_BWLIMIT, e.getMessage());
    }

    nodeConfig.register("inputBandwidthLimit", "-1", sortOrder++, false, true, "Node.inBWLimit", "Node.inBWLimitLong"new IntCallback() {
View Full Code Here

TOP

Related Classes of freenet.support.TokenBucket

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.