class UploadScheduler

Defined at line 21 of file ../../third_party/cobalt/src/uploader/upload_scheduler.h

UploadScheduler enables providing ShippingManager with information about when

to schedule uploads to the backend. If provided with an initial_interval that

is

<

target_interval, it will exponentially increase that interval until it

is equal to target_interval. This allows us to start a cobalt client that

does its first upload quickly, but in the steady state uploads infrequently,

since the longer a device is up, the more likely it is to remain up.

Public Members

static duration kMaxSeconds

Public Methods

lib::statusor::StatusOr<UploadScheduler> Create (UploadScheduleConfig cfg)

target_interval: How frequently should ShippingManager perform regular

periodic sends to the Shuffler? Set to kMaxSeconds to effectively

disable periodic sends.

min_interval: Because of expedited sends, ShippingManager may sometimes

send to the Shuffler more frequently than |target_interval|. This

parameter is a safety setting. ShippingManager will never perform two

sends within a single period of |min_interval| seconds.

initial_interval: Used as the basis for the exponentially increasing

Interval() value. The result of Interval starts by returning this value

and multiplies it by 2 for each call until the value is greater than or

equal to target_interval.

jitter: Used to mitigate risk of synchronized uploads between devices

and hide information about reboot time. Each interval is increased

or decreased by a random value n distributed between 0 and

|jitter| * current_interval.

REQUIRED:

0

<

= min_interval

<

= target_interval

<

= kMaxSeconds

0

<

= jitter

<

1

std::chrono::seconds Interval ()
UploadScheduler ZeroInterval ()

Defined at line 52 of file ../../third_party/cobalt/src/uploader/upload_scheduler.h

std::chrono::seconds MinInterval ()

Defined at line 65 of file ../../third_party/cobalt/src/uploader/upload_scheduler.h