Interface ApiProxy.ApiResultFuture<T>

All Superinterfaces:
Future<T>
Enclosing class:
ApiProxy

public static interface ApiProxy.ApiResultFuture<T> extends Future<T>
A subtype of Future that provides more detailed information about the timing and resource consumption of particular API calls.

Objects returned from ApiProxy.makeAsyncCall(String,String,byte[],ApiConfig) may implement this interface. However, callers should not currently assume that all RPCs will.

  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the amount of CPU time consumed across any backend servers responsible for serving this API call.
    long
    Returns the amount of wallclock time, measured in milliseconds, that this API call took to complete, as measured from the client side.

    Methods inherited from interface java.util.concurrent.Future

    cancel, get, get, isCancelled, isDone
  • Method Details

    • getCpuTimeInMegaCycles

      long getCpuTimeInMegaCycles()
      Returns the amount of CPU time consumed across any backend servers responsible for serving this API call. This quantity is measured in millions of CPU cycles to avoid suming times across a hetergeneous machine set with varied CPU clock speeds.
      Throws:
      IllegalStateException - If the RPC has not yet completed.
    • getWallclockTimeInMillis

      long getWallclockTimeInMillis()
      Returns the amount of wallclock time, measured in milliseconds, that this API call took to complete, as measured from the client side.
      Throws:
      IllegalStateException - If the RPC has not yet completed.