heat.common.timeutils module

heat.common.timeutils module

Utilities for handling ISO 8601 duration format.

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

Bases: object


Stringify UTC time in ISO 8601 format.

Parameters:at – Timestamp in UTC to format.

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)

  • 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

Seconds since epoch to wait until

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.