Test usage reporting for SaaS products

This document shows how to test usage reporting for the SaaS products that you offer through Google Cloud Marketplace.

Before you begin

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:

  1. In Producer Portal, switch to a Google Cloud project that's associated with your Test Billing Account.

  2. From your product's Google Cloud Marketplace listing page, use your Test Billing Account to purchase the product.

  3. 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.

  4. 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.

  5. 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.

  6. 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.