[#BloombergLP-balm-PublicationScheduler]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::PublicationScheduler
:relfileprefix: ../../
:mrdocs:

This class defines a mechanism for scheduling the periodic publication of metrics&period;

== Synopsis

Declared in `&lt;balm&lowbar;publicationscheduler&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class PublicationScheduler;
----

== Description

Each publication scheduler object is supplied the address of a `MetricsManager` and a `bdlmt&colon;&colon;TimerEventScheduler` at construction&period; The metrics manager is used to publish metrics, while the timer&hyphen;event scheduler provides the underlying scheduling mechanism&period; Metrics are scheduled for publication using the `scheduleCategory` and `setDefaultSchedule` methods&period; The `scheduleCategory` method schedules an individual category to be publisher periodically at the provided interval, whereas `setDefaultSchedule` schedules the periodic publication of any category not given an individual schedule&period; The publication scheduler will create a recurring timer for each unique time interval supplied, and will group together categories that share a common time interval into a single call to `MetricsManager&colon;&colon;publish`&period; Note that it is left unspecified whether publication events that occur on a common multiple of _different_ intervals will be grouped into a single invocation of `MetricsManager&colon;&colon;publish`&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/PublicationScheduler/2constructor.adoc[`PublicationScheduler`]         [.small]#[constructor]#
| Create a publication scheduler that publishes via `metricsManager`&period;
| xref:BloombergLP/balm/PublicationScheduler/2destructor.adoc[`&#126;PublicationScheduler`] [.small]#[destructor]#
| Destroy this publication scheduler and cancel pending publications&period;
| xref:BloombergLP/balm/PublicationScheduler/cancelAll.adoc[`cancelAll`] 
| Cancel all periodic publication of metrics&period;
| xref:BloombergLP/balm/PublicationScheduler/cancelCategorySchedule-06.adoc[`cancelCategorySchedule`] 
| Cancel the periodic publication schedule for `category`&period;
| xref:BloombergLP/balm/PublicationScheduler/clearDefaultSchedule.adoc[`clearDefaultSchedule`] 
| Cancel the default publication schedule, if one has been set&period;
| xref:BloombergLP/balm/PublicationScheduler/findCategorySchedule-06.adoc[`findCategorySchedule`] 
| Load into `result` the individual schedule interval for `category`&period;
| xref:BloombergLP/balm/PublicationScheduler/getCategorySchedule-09.adoc[`getCategorySchedule`] 
| Load the current category publication schedule into `result`&period;
| xref:BloombergLP/balm/PublicationScheduler/getDefaultSchedule.adoc[`getDefaultSchedule`] 
| Load into `result` the default scheduled publication interval&period;
| xref:BloombergLP/balm/PublicationScheduler/manager-08.adoc[`manager`] 
| `manager` overloads
| xref:BloombergLP/balm/PublicationScheduler/print.adoc[`print`] 
| Print this scheduler&apos;s state to the specified `stream`&period;
| xref:BloombergLP/balm/PublicationScheduler/scheduleCategory-0b.adoc[`scheduleCategory`] 
| Schedule `category` for periodic publication at `interval`&period;
| xref:BloombergLP/balm/PublicationScheduler/setDefaultSchedule.adoc[`setDefaultSchedule`] 
| Set the default publication interval to the specified `interval`&period;
| xref:BloombergLP/balm/PublicationScheduler/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;PublicationScheduler, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/balm/PublicationScheduler_Proctor.adoc[BloombergLP::balm::PublicationScheduler&lowbar;Proctor]`
| defined in implementation
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
