The attempt count. It is a zero-based value (first attempt will have this value set to 0). For
streamed RPCs this will be reset after every successful message.
The overall attempt count. It is a zero-based value (first attempt will have this value set to
0). This will be the sum of all attempt counts for a streaming RPC and will be equal to #getAttemptCount() for unary RPCs.
Returns randomized attempt delay. By default this value is calculated based on the
retryDelay value, and is used as the actual attempt execution delay.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe latest version available for \u003ccode\u003eTimedAttemptSettings\u003c/code\u003e is 2.63.1, while many other versions are documented, as far back as 2.7.1.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTimedAttemptSettings\u003c/code\u003e is an abstract class that defines time-specific properties for a retry attempt and inherits from \u003ccode\u003ejava.lang.Object\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides methods such as \u003ccode\u003egetAttemptCount()\u003c/code\u003e, \u003ccode\u003egetFirstAttemptStartTimeNanos()\u003c/code\u003e, and \u003ccode\u003egetOverallAttemptCount()\u003c/code\u003e to retrieve information about the attempt.\u003c/p\u003e\n"],["\u003cp\u003eMethods like \u003ccode\u003egetRetryDelayDuration()\u003c/code\u003e and \u003ccode\u003egetRpcTimeoutDuration()\u003c/code\u003e allow developers to access calculated retry delay and RPC timeout values, respectively, for the current attempt.\u003c/p\u003e\n"],["\u003cp\u003eStatic methods like \u003ccode\u003enewBuilder()\u003c/code\u003e and \u003ccode\u003etoBuilder()\u003c/code\u003e can be used to instantiate or create a builder object of the TimedAttemptSettings class.\u003c/p\u003e\n"]]],[],null,["# Class TimedAttemptSettings (2.69.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.69.0 (latest)](/java/docs/reference/gax/latest/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.68.2](/java/docs/reference/gax/2.68.2/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.67.0](/java/docs/reference/gax/2.67.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.66.0](/java/docs/reference/gax/2.66.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.65.0](/java/docs/reference/gax/2.65.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.63.1](/java/docs/reference/gax/2.63.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.62.0](/java/docs/reference/gax/2.62.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.61.0](/java/docs/reference/gax/2.61.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.60.0](/java/docs/reference/gax/2.60.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.59.1](/java/docs/reference/gax/2.59.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.58.0](/java/docs/reference/gax/2.58.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.57.0](/java/docs/reference/gax/2.57.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.55.0](/java/docs/reference/gax/2.55.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.54.1](/java/docs/reference/gax/2.54.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.53.0](/java/docs/reference/gax/2.53.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.52.0](/java/docs/reference/gax/2.52.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.51.0](/java/docs/reference/gax/2.51.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.50.0](/java/docs/reference/gax/2.50.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.49.0](/java/docs/reference/gax/2.49.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.48.1](/java/docs/reference/gax/2.48.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.47.0](/java/docs/reference/gax/2.47.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.46.1](/java/docs/reference/gax/2.46.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.45.0](/java/docs/reference/gax/2.45.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.43.0](/java/docs/reference/gax/2.43.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.42.0](/java/docs/reference/gax/2.42.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.41.0](/java/docs/reference/gax/2.41.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.39.0](/java/docs/reference/gax/2.39.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.38.0](/java/docs/reference/gax/2.38.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.37.0](/java/docs/reference/gax/2.37.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.36.0](/java/docs/reference/gax/2.36.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.35.0](/java/docs/reference/gax/2.35.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.34.1](/java/docs/reference/gax/2.34.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.33.0](/java/docs/reference/gax/2.33.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.32.1](/java/docs/reference/gax/2.32.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.31.1](/java/docs/reference/gax/2.31.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.30.1](/java/docs/reference/gax/2.30.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.24.0](/java/docs/reference/gax/2.24.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.23.3](/java/docs/reference/gax/2.23.3/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.22.0](/java/docs/reference/gax/2.22.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.21.0](/java/docs/reference/gax/2.21.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.20.1](/java/docs/reference/gax/2.20.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.19.6](/java/docs/reference/gax/2.19.6/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.18.7](/java/docs/reference/gax/2.18.7/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.17.0](/java/docs/reference/gax/2.17.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.16.0](/java/docs/reference/gax/2.16.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.15.0](/java/docs/reference/gax/2.15.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.14.0](/java/docs/reference/gax/2.14.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.13.0](/java/docs/reference/gax/2.13.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.12.2](/java/docs/reference/gax/2.12.2/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.11.0](/java/docs/reference/gax/2.11.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.10.0](/java/docs/reference/gax/2.10.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.9.0](/java/docs/reference/gax/2.9.0/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.8.1](/java/docs/reference/gax/2.8.1/com.google.api.gax.retrying.TimedAttemptSettings)\n- [2.7.1](/java/docs/reference/gax/2.7.1/com.google.api.gax.retrying.TimedAttemptSettings) \n\n public abstract class TimedAttemptSettings\n\nTimed attempt execution settings. Defines time-specific properties of a retry attempt. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e TimedAttemptSettings \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Methods\n--------------\n\n### newBuilder()\n\n public static TimedAttemptSettings.Builder newBuilder()\n\nConstructors\n------------\n\n### TimedAttemptSettings()\n\n public TimedAttemptSettings()\n\nMethods\n-------\n\n### getAttemptCount()\n\n public abstract int getAttemptCount()\n\nThe attempt count. It is a zero-based value (first attempt will have this value set to 0). For\nstreamed RPCs this will be reset after every successful message.\n\n### getFirstAttemptStartTimeNanos()\n\n public abstract long getFirstAttemptStartTimeNanos()\n\nThe start time of the first attempt. Note that this value is dependent on the actual ApiClock used during the process.\n\n### getGlobalSettings()\n\n public abstract RetrySettings getGlobalSettings()\n\nReturns global (attempt-independent) retry settings.\n\n### getOverallAttemptCount()\n\n public abstract int getOverallAttemptCount()\n\nThe overall attempt count. It is a zero-based value (first attempt will have this value set to\n0). This will be the sum of all attempt counts for a streaming RPC and will be equal to [#getAttemptCount()](/java/docs/reference/gax/latest/com.google.api.gax.retrying.TimedAttemptSettings#com_google_api_gax_retrying_TimedAttemptSettings_getAttemptCount__) for unary RPCs.\n\n### getRandomizedRetryDelay()\n\n public final Duration getRandomizedRetryDelay()\n\n| **Obsolete**\n|\n| *Use getRandomizedRetryDelayDuration() instead*\n|\n| This feature is stable for usage in this major version, but may be deprecated in a future release.\n\nThis method is obsolete. Use [#getRandomizedRetryDelayDuration()](/java/docs/reference/gax/latest/com.google.api.gax.retrying.TimedAttemptSettings#com_google_api_gax_retrying_TimedAttemptSettings_getRandomizedRetryDelayDuration__) instead\n\n### getRandomizedRetryDelayDuration()\n\n public abstract Duration getRandomizedRetryDelayDuration()\n\nReturns randomized attempt delay. By default this value is calculated based on the `\nretryDelay` value, and is used as the actual attempt execution delay.\n\n### getRetryDelay()\n\n public final Duration getRetryDelay()\n\n| **Obsolete**\n|\n| *Use getRetryDelayDuration() instead*\n|\n| This feature is stable for usage in this major version, but may be deprecated in a future release.\n\nThis method is obsolete. Use [#getRetryDelayDuration()](/java/docs/reference/gax/latest/com.google.api.gax.retrying.TimedAttemptSettings#com_google_api_gax_retrying_TimedAttemptSettings_getRetryDelayDuration__) instead\n\n### getRetryDelayDuration()\n\n public abstract Duration getRetryDelayDuration()\n\nReturns the calculated retry delay. Note that the actual delay used for retry scheduling may be\ndifferent (randomized, based on this value).\n\n### getRpcTimeout()\n\n public final Duration getRpcTimeout()\n\n| **Obsolete**\n|\n| *Use getRpcTimeoutDuration() instead*\n|\n| This feature is stable for usage in this major version, but may be deprecated in a future release.\n\nThis method is obsolete. Use [#getRpcTimeoutDuration()](/java/docs/reference/gax/latest/com.google.api.gax.retrying.TimedAttemptSettings#com_google_api_gax_retrying_TimedAttemptSettings_getRpcTimeoutDuration__) instead\n\n### getRpcTimeoutDuration()\n\n public abstract Duration getRpcTimeoutDuration()\n\nReturns rpc timeout used for this attempt.\n\n### toBuilder()\n\n public abstract TimedAttemptSettings.Builder toBuilder()"]]