Repository navigation
Conversation
93c9a7d to
3c82c2e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Reporter exceptions can mark valid datasets as failed and prevent normal completion.
1 open issue
What changed in this PR
Adds unique resource ID reporting to the service layer for usage metering.
Changes:
- Adds resource collection and reporting APIs.
- Reports resources after worker output computation.
- Adds event definitions and tests for resource collection behavior.
| File | Description |
|---|---|
| service/worker/src/main/java/ai/timefold/solver/service/worker/impl/SolverWorker.java | Reports resources after computation. |
| service/definition/src/test/java/ai/timefold/solver/service/definition/api/usage/UniqueResourcesTest.java | Tests deduplication, immutability, builders and JSON. |
| service/definition/src/main/java/ai/timefold/solver/service/definition/internal/events/UniqueResourceReportEvent.java | Adds the resource reporting event. |
| service/definition/src/main/java/ai/timefold/solver/service/definition/internal/events/SolverChannels.java | Defines the reporting channel. |
| service/definition/src/main/java/ai/timefold/solver/service/definition/internal/events/AbstractEvent.java | Permits the new event type. |
| service/definition/src/main/java/ai/timefold/solver/service/definition/api/usage/UniqueResources.java | Stores immutable, deduplicated resource IDs. |
| service/definition/src/main/java/ai/timefold/solver/service/definition/api/usage/UniqueResourceReporter.java | Defines reporting methods. |
| service/definition/src/main/java/ai/timefold/solver/service/definition/api/usage/UniqueResourceAware.java | Lets models expose their resources. |
Review effort: Balanced
| } | ||
|
|
||
| if (uniqueResources != null) { | ||
| uniqueResourceReporter.reportUniqueResources(OperationId.SCHEDULE, datasetId, uniqueResources); |
| extractOutputMetrics(solverModel)); | ||
|
|
||
| // We report the unique resources once we compute the outputs of the valid dataset. | ||
| reportUniqueResources(id, solverModel); |
|
This pull request, as it stands, would leave the Solver documentation stale in the place below. An automated check found this and can be wrong.
The documentation fix belongs in this pull request. A new commit on the branch updates this comment, and drift that is still there when the group merges gets a docs pull request against
|


Fixes https://github.com/TimefoldAI/timefold-solver-enterprise/issues/930.
The PR covers resource reporting for standard operations.
Also model-specific operations are covered by exposing the
UniqueResourceReporterbean to send the data.Related:
https://github.com/TimefoldAI/timefold-solver-enterprise/pull/948