[#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. == Synopsis Declared in `<balm_publicationscheduler.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class PublicationScheduler; ---- == Description Each publication scheduler object is supplied the address of a `MetricsManager` and a `bdlmt::TimerEventScheduler` at construction. The metrics manager is used to publish metrics, while the timer‐event scheduler provides the underlying scheduling mechanism. Metrics are scheduled for publication using the `scheduleCategory` and `setDefaultSchedule` methods. 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. 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::publish`. 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::publish`. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/PublicationScheduler/2constructor.adoc[`PublicationScheduler`] [.small]#[constructor]# | Create a publication scheduler that publishes via `metricsManager`. | xref:BloombergLP/balm/PublicationScheduler/2destructor.adoc[`~PublicationScheduler`] [.small]#[destructor]# | Destroy this publication scheduler and cancel pending publications. | xref:BloombergLP/balm/PublicationScheduler/cancelAll.adoc[`cancelAll`] | Cancel all periodic publication of metrics. | xref:BloombergLP/balm/PublicationScheduler/cancelCategorySchedule-06.adoc[`cancelCategorySchedule`] | Cancel the periodic publication schedule for `category`. | xref:BloombergLP/balm/PublicationScheduler/clearDefaultSchedule.adoc[`clearDefaultSchedule`] | Cancel the default publication schedule, if one has been set. | xref:BloombergLP/balm/PublicationScheduler/findCategorySchedule-06.adoc[`findCategorySchedule`] | Load into `result` the individual schedule interval for `category`. | xref:BloombergLP/balm/PublicationScheduler/getCategorySchedule-09.adoc[`getCategorySchedule`] | Load the current category publication schedule into `result`. | xref:BloombergLP/balm/PublicationScheduler/getDefaultSchedule.adoc[`getDefaultSchedule`] | Load into `result` the default scheduled publication interval. | xref:BloombergLP/balm/PublicationScheduler/manager-08.adoc[`manager`] | `manager` overloads | xref:BloombergLP/balm/PublicationScheduler/print.adoc[`print`] | Print this scheduler's state to the specified `stream`. | xref:BloombergLP/balm/PublicationScheduler/scheduleCategory-0b.adoc[`scheduleCategory`] | Schedule `category` for periodic publication at `interval`. | xref:BloombergLP/balm/PublicationScheduler/setDefaultSchedule.adoc[`setDefaultSchedule`] | Set the default publication interval to the specified `interval`. | xref:BloombergLP/balm/PublicationScheduler/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<PublicationScheduler, UsesBslmaAllocator>`] | Declare that this type uses a `bslma` allocator. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:BloombergLP/balm/PublicationScheduler_Proctor.adoc[BloombergLP::balm::PublicationScheduler_Proctor]` | defined in implementation |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#