Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-2583

Tally usage and Tallysnapshot have different monthly total

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • True

      For the org:11789772 on stage we get different total for May for product `rhel-for-x86-els-payg`. 
      We noticed that May 9th has more usage if we add events compared to Daily total in tally_snapshot.
      We identified this while running long running test script against stage.

      Tally_snapshot query:

      gabi "select distinct ts1_0.id,ts1_0.billing_account_id,ts1_0.billing_provider,ts1_0.granularity,ts1_0.org_id,ts1_0.product_id,
                      ts1_0.sla,ts1_0.snapshot_date,tm1_0.snapshot_id,tm1_0.measurement_type,tm1_0.metric_id,tm1_0.value,ts1_0.usage
      from tally_snapshots ts1_0 left join tally_measurements tm1_0 on ts1_0.id=tm1_0.snapshot_id where ts1_0.org_id='11789772'
            and ts1_0.product_id='rhel-for-x86-els-payg' and ts1_0.sla='_ANY' and ts1_0.usage='_ANY' and ts1_0.billing_provider='_ANY' and ts1_0.billing_account_id='_ANY'
            and ts1_0.snapshot_date between '2024-05-09T00:00Z' and '2024-05-09T23:59:59Z'  and granularity='DAILY' order by ts1_0.snapshot_date"

      Tally_usage:

      gabi "select * from events e where e.org_id='11789772' and e.data->'product_tag'->>0 = 'rhel-for-x86-els-payg' and e.record_date between '2024-05-09T00:00:00' and '2024-05-09T23:59:59Z' order by record_date"

       

      Bug Details

      When this bug occurs, the issue should be noticeable when using the API to produce a tally report with an 'Hourly' granularity. This is because the hourly snapshot measurements within the affected range were removed and will not be included in the results.

       

      Steps To Reproduce:

      1. Create a series of events from 2024-06-05T00:00Z to 2024-06-05T10:00Z
      2. Perform and hourly tally for the org.
      3. Create 2 events that create a range over the total span of the initial events created.
        1. 2024-06-05T00:00Z
        2. 2024-06-05T10:00Z
      4. Perform an hourly tally for the org.
      5. Use the tally report API to get the hourly values for the total range of events.

      The tally report should show a value of 0 (no data) for all event timestamps in the middle of the range, but the correct result for the timestamps of events in step 3.

       

              mstead@redhat.com Michael Stead
              karshah@redhat.com Kartik Shah
              Lisa Walker Lisa Walker
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: