railwatch 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c621aa5be8712487e490453e9b62ab5d3f75666b951270d50acf77b00ad03a29
4
- data.tar.gz: 5464f54bb6968924b1155456dcd22c5dada112980760340beb74632a169d5791
3
+ metadata.gz: d3e41b1890c573cc71fe35d7a9ac134dc3964e4250126bd7c898132800ba47d9
4
+ data.tar.gz: 84f59bb0bc68c014618c564533b0f3a5266062b1fac93a252a5a41c3632f0136
5
5
  SHA512:
6
- metadata.gz: 035642f4a96ae1803f01079f618315a7c1ff54657f6111f52071ae32896782118a40e3f7075ddfb60910625899e589c5cea8f5b3b7c999af42211d097eb2e161
7
- data.tar.gz: 4dc2f2217692fa974f06c7c2c7b487896206a0cefccd7301f9802d3eb192dc47900bdfdf96a9a07809d86b41c6a59292fc0df27382b7636167331fcb59c02978
6
+ metadata.gz: 4472da6ecdbb054cd17cae2a31cf3d1f0a5a6237e4964af2c9da04fa2b754a95a7aa91c268dd43ef9a29791762b82c2edffb446557b0f2b6b5a3a47f6b504a8c
7
+ data.tar.gz: 276639c1d1f4c9632892a419f83443407a41af5e33c062a426e50bf9a3f5fa8daf039b267157c14079e2c826dbd5b025e0a2e955d43450d28b59be31637fb6b4
data/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@
6
6
  filled in by the release commit, which is also the only commit that
7
7
  touches lib/railwatch/version.rb and Gemfile.lock. See CONTRIBUTING.md. -->
8
8
 
9
+ ## 0.8.2 (2026-09-23)
10
+
11
+ - The Profiles page's profiled share counts only the executions inside
12
+ its window. A window starting or ending mid-hour counted the whole of
13
+ its first and last hours, because a rollup holds its whole hour; the
14
+ partial hours are now counted from the rows.
15
+
9
16
  ## 0.8.1 (2026-09-23)
10
17
 
11
18
  - The Tenants page reads only through the tenant-led indexes. Sparklines
@@ -30,16 +30,18 @@ module Railwatch
30
30
  private
31
31
 
32
32
  # How many executions the window holds, as the profiled share's
33
- # denominator. Every kind is rolled up, so the whole hours come from a
34
- # few hundred rollup rows rather than counting every execution (1.2 s
35
- # over a week of the platform's own); only the part of the first hour
36
- # inside the window is counted from the rows.
33
+ # denominator. Every kind is rolled up, so whole hours come from a few
34
+ # hundred rollup rows rather than counting every execution (1.2 s over a
35
+ # week of the platform's own). A rollup holds its whole hour, so the
36
+ # partial hours at either end of the window are counted from the rows.
37
37
  def executions_in(from, to)
38
- whole = from.beginning_of_hour == from ? from : from.beginning_of_hour + 1.hour
39
- return Telemetry::Execution.between(from, to).count if whole >= to
38
+ first = from.beginning_of_hour == from ? from : from.beginning_of_hour + 1.hour
39
+ last = to.beginning_of_hour
40
+ return Telemetry::Execution.between(from, to).count if first >= last
40
41
 
41
- Telemetry::Execution.where(occurred_at: from...whole).count +
42
- Telemetry::Rollup.for_type(Telemetry::Execution::KINDS).between(whole, to).sum(:count)
42
+ Telemetry::Execution.where(occurred_at: from...first).count +
43
+ Telemetry::Rollup.for_type(Telemetry::Execution::KINDS).where(bucket: first...last).sum(:count) +
44
+ Telemetry::Execution.where(occurred_at: last..to).count
43
45
  end
44
46
 
45
47
  # Rows arrive newest-first, so the head of each group is the profile the
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Railwatch
4
- VERSION = "0.8.1"
4
+ VERSION = "0.8.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cole Robertson