scope matches the scope you requested, which makes it straightforward to associate a value with the metric shown in your user interface.
A metric value is
null until the solver publishes its first metrics update, or when the selected scope has no value.Scope metrics with rule labels
A metric scope is defined by itsmetricKey and, optionally, its ruleLabel:
ruleLabel can only be used for metrics based on labeled rules.- With only a
metricKey, the service aggregates that metric across every rule of the relevant type. - With both a
metricKeyandruleLabel, it aggregates only rules of that type that have the exact, case-sensitive label.
maximum-weekend-amount, then request PERIOD_DISTRIBUTION.EXCESSIVE_WORKED_PERIODS with that label. The result is the total number of excessive weekend periods across all matching rules.
Track excessive weekend periods
Track and show metrics
1
Choose the metrics to track
Add each metric scope to
statusOptions.metricScopes in your POST /roster/start request. A scope can track a metric across all matching rules, or use ruleLabel to limit it to a labeled group of rules.Add status options to the roster start request
2
Start the roster job
Send the roster start request and retain the returned
jobId. The service creates one status-metric entry for every requested scope.3
Poll the job status
Call
GET /roster/status/{jobId} while the job runs. Each response contains the latest values in the metrics array, using the same scopes you requested.Metrics returned when checking job status
4
Show progress to users
Match every returned
scope to the metric in your interface and update its displayed value on each poll. Values will move as the solver improves the roster.