Package freenet.node.RequestTracker

Examples of freenet.node.RequestTracker.CountedRequests


     * This is not predictable, so we use an average.
     * @param realTimeFlag If true, count real-time requests, if false, count bulk requests. */
    RunningRequestsSnapshot(RequestTracker tracker, boolean ignoreLocalVsRemote, int transfersPerInsert, boolean realTimeFlag) {
      this.averageTransfersPerInsert = transfersPerInsert;
      this.realTimeFlag = realTimeFlag;
      CountedRequests countCHK = new CountedRequests();
      CountedRequests countSSK = new CountedRequests();
      CountedRequests countCHKSR = new CountedRequests();
      CountedRequests countSSKSR = new CountedRequests();
      tracker.countRequests(true, false, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(true, true, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(true, false, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(true, true, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(false, false, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(false, true, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(false, false, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(false, true, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(false, false, false, true, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(false, true, false, true, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      this.expectedTransfersInCHK = countCHK.expectedTransfersIn();
      this.expectedTransfersInSSK = countSSK.expectedTransfersIn();
      this.expectedTransfersOutCHK = countCHK.expectedTransfersOut();
      this.expectedTransfersOutSSK = countSSK.expectedTransfersOut();
      this.totalRequests = countCHK.total() + countSSK.total();
      this.expectedTransfersInCHKSR = countCHKSR.expectedTransfersIn();
      this.expectedTransfersInSSKSR = countSSKSR.expectedTransfersIn();
      this.expectedTransfersOutCHKSR = countCHKSR.expectedTransfersOut();
      this.expectedTransfersOutSSKSR = countSSKSR.expectedTransfersOut();
      this.totalRequestsSR = countCHKSR.total() + countSSKSR.total();
    }
View Full Code Here


      this.averageTransfersPerInsert = transfersPerInsert;
      this.realTimeFlag = realTimeFlag;
      // We are calculating what part of their resources we use. Therefore, we have
      // to see it from their point of view - meaning all the requests are remote.
      if(requestsToNode) ignoreLocalVsRemote = true;
      CountedRequests countCHK = new CountedRequests();
      CountedRequests countSSK = new CountedRequests();
      CountedRequests countCHKSR = null;
      CountedRequests countSSKSR = null;
      if(!requestsToNode) {
        // No point counting if it's requests to the node.
        // Restarted only matters for requests from a node.
        countCHKSR = new CountedRequests();
        countSSKSR = new CountedRequests();
      }
      tracker.countRequests(source, requestsToNode, true, false, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(source, requestsToNode, true, true, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(source, requestsToNode, true, false, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(source, requestsToNode, true, true, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(source, requestsToNode, false, false, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(source, requestsToNode, false, true, false, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(source, requestsToNode, false, false, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(source, requestsToNode, false, true, true, false, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      tracker.countRequests(source, requestsToNode, false, false, false, true, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countCHK, countCHKSR);
      tracker.countRequests(source, requestsToNode, false, true, false, true, realTimeFlag, transfersPerInsert, ignoreLocalVsRemote, countSSK, countSSKSR);
      if(!requestsToNode) {
        this.expectedTransfersInCHKSR = countCHKSR.expectedTransfersIn();
        this.expectedTransfersInSSKSR = countSSKSR.expectedTransfersIn();
        this.expectedTransfersOutCHKSR = countCHKSR.expectedTransfersOut();
        this.expectedTransfersOutSSKSR = countSSKSR.expectedTransfersOut();
        this.totalRequestsSR = countCHKSR.total() + countSSKSR.total();
        this.expectedTransfersInCHK = countCHK.expectedTransfersIn() - expectedTransfersInCHKSR;
        this.expectedTransfersInSSK = countSSK.expectedTransfersIn() - expectedTransfersInSSKSR;
        this.expectedTransfersOutCHK = countCHK.expectedTransfersOut() - expectedTransfersOutCHKSR;
        this.expectedTransfersOutSSK = countSSK.expectedTransfersOut() - expectedTransfersOutSSKSR;
        this.totalRequests = (countCHK.total() + countSSK.total()) - totalRequestsSR;
View Full Code Here

TOP

Related Classes of freenet.node.RequestTracker.CountedRequests

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.