Package com.aelitis.azureus.core.speedmanager

Examples of com.aelitis.azureus.core.speedmanager.SpeedManagerLimitEstimate


     * @return - index of dropdown that matches or -1 to indicate no match.
     */
    private int setDefaultConfidenceLevelEx(int transferRateKBPS, boolean testRan, boolean isUpload, String[] values){

        float retValType;
        SpeedManagerLimitEstimate est;
        if(isUpload){
            est = speedManager.getEstimatedUploadCapacityBytesPerSec();
        }else{
            est = speedManager.getEstimatedDownloadCapacityBytesPerSec();
        }
        float originalEstType = est.getEstimateType();

        //if it was previous Fixed leave it alone.
        if( originalEstType==SpeedManagerLimitEstimate.TYPE_MANUAL ){
            retValType = originalEstType;
        }else if( !testRan ){
View Full Code Here


    public int determineRateSettingEx(int measuredRate, boolean testRan, boolean isUpload)
    {
        int retVal = measuredRate;

        //get speed-manager setting.
        SpeedManagerLimitEstimate est;
        if( isUpload ){
            est = speedManager.getEstimatedUploadCapacityBytesPerSec();
        }else{
            est = speedManager.getEstimatedDownloadCapacityBytesPerSec();
        }

        //Use previous value if no test of this type ran.
        if( !testRan ){
            retVal = est.getBytesPerSec()/1024;
        }

        //if the previous set to Manually use that value.
        if( est.getEstimateType()==SpeedManagerLimitEstimate.TYPE_MANUAL ){
            retVal = est.getBytesPerSec()/1024;
        }

        return retVal;
    }
View Full Code Here

        gridData.widthHint = 380;
        label.setLayoutData(gridData);
        Messages.setLanguageText(label,"SpeedTestWizard.finish.panel.click.close");

        //show the setting for upload speed
        SpeedManagerLimitEstimate upEst = speedManager.getEstimatedUploadCapacityBytesPerSec();
        int maxUploadKbs = upEst.getBytesPerSec()/1024;
        SpeedManagerLimitEstimate downEst = speedManager.getEstimatedDownloadCapacityBytesPerSec();
        int maxDownloadKbs = downEst.getBytesPerSec()/1024;

        //boolean setting.
        boolean autoSpeedEnabled = COConfigurationManager.getBooleanParameter( TransferSpeedValidator.AUTO_UPLOAD_ENABLED_CONFIGKEY );
        boolean autoSpeedSeedingEnabled = COConfigurationManager.getBooleanParameter( TransferSpeedValidator.AUTO_UPLOAD_SEEDING_ENABLED_CONFIGKEY );
View Full Code Here

      label.setLayoutData(gridData);

        String co_up    = "AutoSpeed Network Upload Speed (temp)";
        String co_up_type   = "AutoSpeed Network Upload Speed Type (temp)";

        SpeedManagerLimitEstimate up_lim = sm.getEstimatedUploadCapacityBytesPerSec();
       
        COConfigurationManager.setParameter( co_up, up_lim.getBytesPerSec()/1024 );
    COConfigurationManager.setParameter( co_up_type, limit_to_text.getSettableType( up_lim ));
   
    final IntParameter max_upload = new IntParameter(networkGroup, co_up );
       
    final Label upload_bits = new Label(networkGroup, SWT.NULL);
      gridData = new GridData();
      upload_bits.setLayoutData(gridData);
      upload_bits.setText(getMBitLimit(limit_to_text,(up_lim.getBytesPerSec()/1024)*1024));
   
    final StringListParameter max_upload_type =
      new StringListParameter(networkGroup, co_up_type, limit_to_text.getSettableTypes(),limit_to_text.getSettableTypes() );
     
    max_upload_type.addChangeListener(
      new ParameterChangeAdapter()
      {
        public void
        parameterChanged(
          Parameter   p,
          boolean   caused_internally )
        {
          if ( max_upload_type.isDisposed()){
         
            return;
          }
         
          float type = limit_to_text.textToType( max_upload_type.getValue());
             
          SpeedManagerLimitEstimate existing = sm.getEstimatedUploadCapacityBytesPerSec();
         
          if ( existing.getEstimateType() != type ){
         
            sm.setEstimatedUploadCapacityBytesPerSec( existing.getBytesPerSec(), type );
          }
        }
      });
     
    max_upload.addChangeListener(
      new ParameterChangeAdapter()
      {
        public void
        parameterChanged(
          Parameter   p,
          boolean   caused_internally )
        {
          if ( max_upload.isDisposed()){
         
            return;
          }
                   
          int  value = max_upload.getValue() * 1024;
               
          SpeedManagerLimitEstimate existing = sm.getEstimatedUploadCapacityBytesPerSec();
         
          if ( existing.getBytesPerSec() != value ){
         
            sm.setEstimatedUploadCapacityBytesPerSec( value, existing.getEstimateType());
          }
        }
      });     
   
      label = new Label(networkGroup, SWT.NULL);

        // down set
     
      label = new Label(networkGroup, SWT.NULL);
      Messages.setLanguageText(label,"SpeedView.stats.estdowncap");   
      gridData = new GridData();
      gridData.horizontalIndent = 20;
      label.setLayoutData(gridData);

        SpeedManagerLimitEstimate down_lim = sm.getEstimatedDownloadCapacityBytesPerSec();

        String co_down      = "AutoSpeed Network Download Speed (temp)";
    String co_down_type   = "AutoSpeed Network Download Speed Type (temp)";
        COConfigurationManager.setParameter( co_down, down_lim.getBytesPerSec()/1024 );
        COConfigurationManager.setParameter( co_down_type, limit_to_text.getSettableType( down_lim ));

    final IntParameter max_download = new IntParameter(networkGroup, co_down );
     
    final Label download_bits = new Label(networkGroup, SWT.NULL);
      gridData = new GridData();
      download_bits.setLayoutData(gridData);
      download_bits.setText(getMBitLimit(limit_to_text,(down_lim.getBytesPerSec()/1024)*1024));
     
    final StringListParameter max_download_type =
      new StringListParameter(networkGroup, co_down_type, limit_to_text.getSettableTypes(),limit_to_text.getSettableTypes() );

    max_download_type.addChangeListener(
      new ParameterChangeAdapter()
      {
        public void
        parameterChanged(
          Parameter   p,
          boolean   caused_internally )
        {
          if ( max_download_type.isDisposed()){
         
            return;
          }
         
          float type = limit_to_text.textToType( max_download_type.getValue());
             
          SpeedManagerLimitEstimate existing = sm.getEstimatedDownloadCapacityBytesPerSec();
         
          if ( existing.getEstimateType() != type ){
         
            sm.setEstimatedDownloadCapacityBytesPerSec( existing.getBytesPerSec(), type );
          }
        }
      });
   
    max_download.addChangeListener(
      new ParameterChangeAdapter()
      {
        public void
        parameterChanged(
          Parameter   p,
          boolean   caused_internally )
        {
          if ( max_download.isDisposed()){
         
            return;
          }
                   
          int  value = max_download.getValue() * 1024;
               
          SpeedManagerLimitEstimate existing = sm.getEstimatedDownloadCapacityBytesPerSec();
         
          if ( existing.getBytesPerSec() != value ){
         
            sm.setEstimatedDownloadCapacityBytesPerSec( value, existing.getEstimateType());
          }
        }
      });
   
      label = new Label(networkGroup, SWT.NULL);

        // reset
     
      Label reset_label = new Label(networkGroup, SWT.NULL );
      Messages.setLanguageText(reset_label, CFG_PREFIX + "resetnetwork");

      Button reset_button = new Button(networkGroup, SWT.PUSH);

      Messages.setLanguageText(reset_button, CFG_PREFIX + "reset.button" );

      reset_button.addListener(SWT.Selection,
        new Listener()
      {
            public void
        handleEvent(Event event)
            {
              sm.reset();
            }
        });
       
     sm.addListener(
             new SpeedManagerListener()
             {
               private final SpeedManagerListener  listener = this;
              
               public void
               propertyChanged(
                 final int property
               {
                 Utils.execSWTThread(
                   new Runnable()
                   {
                     public void
                     run()
                     {
                       if ( asn_label.isDisposed()){
                        
                         sm.removeListener( listener );
                        
                       }else{
                        
                         if ( property == SpeedManagerListener.PR_ASN ){
                          
                           asn_label.setText( sm.getASN());
                          
                          }else if ( property == SpeedManagerListener.PR_UP_CAPACITY ){
                            
                            SpeedManagerLimitEstimate limit = sm.getEstimatedUploadCapacityBytesPerSec();
                           
                           up_cap.setText( limit_to_text.getLimitText( limit ));
                            
                           upload_bits.setText(getMBitLimit(limit_to_text, limit.getBytesPerSec()));
                          
                           max_upload.setValue( limit.getBytesPerSec()/1024 );
                          
                           max_upload_type.setValue( limit_to_text.getSettableType( limit ));
                          
                          }else if ( property == SpeedManagerListener.PR_DOWN_CAPACITY ){
                        
                            SpeedManagerLimitEstimate limit = sm.getEstimatedDownloadCapacityBytesPerSec();

                         down_cap.setText( limit_to_text.getLimitText( limit ));
                        
                         download_bits.setText(getMBitLimit(limit_to_text, limit.getBytesPerSec()));
                          
                           max_download.setValue( limit.getBytesPerSec()/1024 );
                          
                           max_download_type.setValue( limit_to_text.getSettableType( limit ));
              
                         }
                       }
View Full Code Here

         
          rate_limit = DEFAULT_UP_LIMIT;
        }
      }
     
      SpeedManagerLimitEstimate last_bad = mapper.getLastBadUploadLimit();
           
      if ( last_bad != null ){
       
        int last_bad_limit = last_bad.getBytesPerSec();
               
        if ( last_bad_limit != pm_last_bad_limit ){
         
          pm_last_bad_limit = last_bad_limit;
     
          SpeedManagerLimitEstimate[] bad_ups = mapper.getBadUploadHistory();
   
          int    total   = last_bad.getBytesPerSec();
          int    count  = 1;
         
          for ( SpeedManagerLimitEstimate bad: bad_ups ){
           
            long  t = bad.getWhen();
View Full Code Here

    public static SpeedManagerLimitEstimate getUploadLimit(boolean persistent){
        try{
            SMInstance pm = SMInstance.getInstance();
            SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
            SpeedManagerPingMapper persistentMap = adapter.getPingMapper();
            SpeedManagerLimitEstimate upEst = persistentMap.getEstimatedUploadLimit(true);

            return upEst;
           
        }catch(Throwable t){
            //log this event and
View Full Code Here

    {
        try{
            SMInstance pm = SMInstance.getInstance();
            SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
            SpeedManager sm = adapter.getSpeedManager();
            SpeedManagerLimitEstimate upEstCapacity = sm.getEstimatedUploadCapacityBytesPerSec();

            return upEstCapacity;

        }catch(Throwable t){
            //log this event and
View Full Code Here

    public static SpeedManagerLimitEstimate getDownloadLimit(){
        try{
            SMInstance pm = SMInstance.getInstance();
            SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
            SpeedManagerPingMapper persistentMap = adapter.getPingMapper();
            SpeedManagerLimitEstimate downEst = persistentMap.getEstimatedDownloadLimit(true);

            return downEst;

        }catch(Throwable t){
            //log this event and
View Full Code Here

    {
        try{
            SMInstance pm = SMInstance.getInstance();
            SpeedManagerAlgorithmProviderAdapter adapter = pm.getAdapter();
            SpeedManager sm = adapter.getSpeedManager();
            SpeedManagerLimitEstimate downEstCapacity = sm.getEstimatedDownloadCapacityBytesPerSec();

            return downEstCapacity;

        }catch(Throwable t){
            //log this event and
View Full Code Here

            mon.readFromPersistentMap();
            mon.updateFromCOConfigManager();
            SMSearchLogger.log("ASN change.");
        }else if( property == SpeedManagerListener.PR_DOWN_CAPACITY ){
            type = "download capacity";
            SpeedManagerLimitEstimate pmEst = PingSpaceMon.getDownloadLimit();
            SpeedManagerLimitEstimate smEst = PingSpaceMon.getDownloadEstCapacity();

            SMSearchLogger.log( " download - persistent limit: "+pmEst.getString() );
            SMSearchLogger.log( " download - estimated capacity: "+smEst.getString() );

            mon.notifyDownload( smEst );
        }else if( property == SpeedManagerListener.PR_UP_CAPACITY ){
            type = "upload capacity";
            SpeedManagerLimitEstimate shortTermLimit = PingSpaceMon.getUploadLimit(false);
            SpeedManagerLimitEstimate pmEst = PingSpaceMon.getUploadLimit(true);
            SpeedManagerLimitEstimate smEst = PingSpaceMon.getUploadEstCapacity();

            SMSearchLogger.log( " upload - short term limit: "+shortTermLimit.getString() );
            SMSearchLogger.log( " upload - persistent limit: "+pmEst.getString() );
            SMSearchLogger.log( " upload - estimated capacity: "+smEst.getString() );

            mon.notifyUpload( smEst );
        }

        SpeedManagerLogger.log("Updated from SpeedManagerPingMapper property="+type);       
View Full Code Here

TOP

Related Classes of com.aelitis.azureus.core.speedmanager.SpeedManagerLimitEstimate

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.