This document shows how to test usage reporting for the SaaS products that you offer through Google Cloud Marketplace.
Before you begin
To test usage reporting, your product's pricing plan must be approved by Google. For more details, see Submit your pricing for review.
Make sure that you use a Test Billing Account, which has 100% discounted usage. For steps to set up a Test Billing Account, see Create a Test Billing Account.
Verify that you've turned on Customer incremental insights reports. This involves the following steps:
Run a test to generate usage
You verify your usage reporting by running a test that generates usage reports, and then comparing the usage reports to your expected outcomes. To run the test, do the following:
In Producer Portal, switch to a Google Cloud project that's associated with your Test Billing Account.
From your product's Google Cloud Marketplace listing page, use your Test Billing Account to purchase the product.
Send an initial usage report for a single, recognizable metric. This should equal more than US$0.01, and be less than the amount of usage that you expect for one hour of usage. For example, if your product bills per GiB per hour, send a single usage report that's equivalent to one GiB per hour. This makes it easier to verify that metering and billing are working as expected when you compare against the Customer incremental insights report.
For details about how to send usage reports, including how to format reports and usage times, see Reporting usage to Google.
Continue to send at least one usage report per hour for at least six hours. If you send more than one usage report per hour, this doesn't affect the required minimum length of the test, which remains six hours.
For the duration of the testing period, create logs that contain the usage information that you're reporting in Google Sheets or CSV format, with the following format:
Time (UTC) operationID
startTime
endTime
consumerId
metricName
metricValue
TIME OPERATION_ID START_TIME END_TIME project_number: PROJECT_NUMBER METRIC_NAME METRIC_VALUE Provide these logs, in Google Sheets or CSV format, to your Cloud Marketplace partner engineering team.
After you receive the Customer incremental insights report corresponding to the time period during which you ran your tests, Google compares the values in your report with your expected values, including the following fields:
charges
sku_id
sku_description
usage
unit
currency
external_account_id
Google sends you the results of their comparison.
Clean up after testing
After Google receives and verifies your usage from the testing period, you clean up the resources that you created for testing by doing the following:
- Stop sending usage reports for the entitlements that you created for testing.
- Cancel all entitlements that you created for testing.
- Remove any Google team members that you added to your Cloud Billing account during testing.
Related topics
- Preview your product in Producer Portal, to see how it appears to Google Cloud Marketplace users.
- Preview your product's pricing.
- Run validation tests on your product.