heat.common.timeutils module

Utilities for handling ISO 8601 duration format.

class heat.common.timeutils.Duration(timeout=0)[source]

Bases: object

endtime()[source]
expired()[source]
heat.common.timeutils.isotime(at)[source]

Stringify UTC time in ISO 8601 format.

Parameters:

at – Timestamp in UTC to format.

heat.common.timeutils.parse_isoduration(duration)[source]

Convert duration in ISO 8601 format to second(s).

Year, Month, Week, and Day designators are not supported. Example: ‘PT12H30M5S’

heat.common.timeutils.retry_backoff_delay(attempt, scale_factor=1.0, jitter_max=0.0)[source]

Calculate an exponential backoff delay with jitter.

Delay is calculated as 2^attempt + (uniform random from [0,1) * jitter_max)

Parameters:
  • attempt – The count of the current retry attempt

  • scale_factor – Multiplier to scale the exponential delay by

  • jitter_max – Maximum of random seconds to add to the delay

Returns:

Seconds since epoch to wait until