From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- apidocs/com/amazon/carbonado/util/Throttle.html | 300 ++++++++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/util/Throttle.html (limited to 'apidocs/com/amazon/carbonado/util/Throttle.html') diff --git a/apidocs/com/amazon/carbonado/util/Throttle.html b/apidocs/com/amazon/carbonado/util/Throttle.html new file mode 100644 index 0000000..92bb111 --- /dev/null +++ b/apidocs/com/amazon/carbonado/util/Throttle.html @@ -0,0 +1,300 @@ + + + + + + +Throttle (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.util
+

Class Throttle

+
+
+ +
+
    +
  • +
    +
    +
    public class Throttle
    +extends java.lang.Object
    +
    General purpose class for throttling work relative to its actual measured + performance. To throttle a task, call the throttle method each time a unit + of work has been performed. It computes a rolling average for the amount of + time it takes to perform some work, and then it sleeps a calculated amount + of time to throttle back. + +

    Instances are intended for use by one thread, and so they are not + thread-safe.

    +
    Author:
    +
    Brian S O'Neill
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      Throttle(int windowSize) 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      static voidmain(java.lang.String[] args) +
      Test program which exercises the CPU in an infinite loop, throttled by + the amount given in args[0].
      +
      voidthrottle(double desiredSpeed, + long sleepPrecisionMillis) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Throttle

        +
        public Throttle(int windowSize)
        +
        Parameters:
        windowSize - amount of samples to keep in the rolling average
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        throttle

        +
        public void throttle(double desiredSpeed,
        +            long sleepPrecisionMillis)
        +              throws java.lang.InterruptedException
        +
        Parameters:
        desiredSpeed - 1.0 = perform work at full speed, + 0.5 = perform work at half speed, 0.0 = fully suspend work
        sleepPrecisionMillis - sleep precision, in milliseconds. Typical + value is 10 to 100 milliseconds.
        +
        Throws:
        +
        java.lang.InterruptedException
        +
      • +
      + + + +
        +
      • +

        main

        +
        public static void main(java.lang.String[] args)
        +                 throws java.lang.Exception
        +
        Test program which exercises the CPU in an infinite loop, throttled by + the amount given in args[0]. On a machine performing no other work, the + average CPU load should be about the same as the throttled speed.
        +
        Parameters:
        args - args[0] - desired speed, 0.0 to 1.0
        +
        Throws:
        +
        java.lang.Exception
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3