-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SWATCH-2461: Add new field "currentTotal" into the snapshot model (#3269
) Jira issue: [SWATCH-2461](https://issues.redhat.com/browse/SWATCH-2461) ## Description The billable usage and snapshot measurements models should contain a new field for the "currentTotal" value. The snapshot measurement one is calculated via SQL query and it's copied over the new billable usage field. ## Testing 1.- podman-compose up 2.- start the tally service: ``` LOGGING_LEVEL_ORG_CANDLEPIN_SUBSCRIPTIONS_TALLY_BILLING=DEBUG \ SUBSCRIPTION_USE_STUB=true \ USER_USE_STUB=true \ CONTRACT_USE_STUB=true \ DEV_MODE=true \ ./gradlew :bootRun ``` 3.- send tally summary message into the topic "platform.rhsm-subscriptions.tally": ``` {"org_id": "org123", "tally_snapshots": [{"billing_provider":"aws", "billing_account_id": "123", "snapshot_date": "2023-12-21T01:10:28Z", "product_id": "rosa", "sla": "Premium", "usage": "Production", "granularity": "Hourly", "tally_measurements": [{"hardware_measurement_type": "AWS", "metric_id": "Cores", "value": 12}]}]} ``` And you should see the following message in the tally service: ``` [DEBUG] [org.candlepin.subscriptions.tally.billing.BillingProducer] - Sending billable usage org.candlepin.subscriptions.json.BillableUsage@4471ce00[uuid=<null>,orgId=org123,id=<null>,billingProvider=aws,billingAccountId=123,snapshotDate=2024-04-18T08:29:36.237472693Z,productId=rosa,sla=Premium,usage=Production,status=<null>,errorCode=<null>,billedOn=<null>,uom=<null>,metricId=Cores,value=0.0,billingFactor=0.25,vendorProductCode=<null>,hardwareMeasurementType=AWS,currentTotal=0.0] to topic platform.rhsm-subscriptions.billable-usage ``` Note the new field **currentTotal**.
- Loading branch information
Showing
8 changed files
with
160 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.