rails_event_viewer 0.4.1 → 0.4.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: d23e7d737a8e9d46d9ccbc7b5eafca59dbff648f3fd8deef10576d45555fbe3a
4
- data.tar.gz: 9931baf5951842895eeacb45a87d56e50f2294dbbb0b105972995bdcfd7becf9
3
+ metadata.gz: 2f0fbcd20727cc831799761717b5a0ef9a0976c62ca2452aea717000583d9ad5
4
+ data.tar.gz: 7e00df561d871f1d1df3de563f14c55bee8f0bcd006b6ce8b46db6b86bc7cb07
5
5
  SHA512:
6
- metadata.gz: ca612bc3fc3a3f16fa398cac9179a5dd23adc54021384693f552abc6333789ed6c8b0fb9904c3b7ca5a57bdfb90e60857292be0bd395beb82f99cbd05118f016
7
- data.tar.gz: 89c8fe09a4ca8a901b2737b013280cbea230ca8a7ab9c10ffd5656a0e2e5214f30667e11e9f8a23e5c6db49575e9cda27851f060336ece2f08b985aa52e2015f
6
+ metadata.gz: 9ac49e92ecd8fdf32706ca80986bb501d28ca8f9b6af3b12402501d120540e06281cf1f25c43420aaf8f4c3a721c49eef53d66f384e66bd4f4bf3f7ed3bb1f10
7
+ data.tar.gz: c8b0877b48cd334a30bd8345f9f9b9085227df835dd651e35c4ef0b63615ef4fbd466a2818bde6017469cc255e35d4ff63ebd9d349f7ea6bbffea3d4f9c258b3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.2 (2026-10-04)
4
+
5
+ Changed:
6
+
7
+ - Group durations are rounded and show only the two largest units.
8
+ - Source paths on the event page are shortened. Hover shows the full path.
9
+ - The event count has thousands separators.
10
+ - The events-by-type chart uses ten distinct colours.
11
+ - Timeline offsets step through minutes, hours and days.
12
+ - The 24-hour chart starts on a whole hour.
13
+
3
14
  ## 0.4.1 (2026-10-03)
4
15
 
5
16
  Added:
@@ -8,7 +8,7 @@ module RailsEventViewer
8
8
 
9
9
  if analytics_supported?
10
10
  @events_by_type = current_adapter.counts_by_name(limit: 10)
11
- @events_over_time = current_adapter.events_over_time(range: 24.hours.ago.., interval: :hour)
11
+ @events_over_time = current_adapter.events_over_time(range: 24.hours.ago.beginning_of_hour.., interval: :hour)
12
12
  else
13
13
  @events_by_type = {}
14
14
  @events_over_time = {}
@@ -58,12 +58,12 @@ module RailsEventViewer
58
58
  def format_duration(seconds)
59
59
  return "-" unless seconds
60
60
 
61
- duration = ActiveSupport::Duration.build(seconds)
61
+ duration = ActiveSupport::Duration.build(seconds.round)
62
62
  parts = duration.parts
63
63
 
64
64
  return "0 seconds" if parts.empty? || parts == { seconds: 0 }
65
65
 
66
- parts.map { |unit, value|
66
+ parts.first(2).map { |unit, value|
67
67
  unit_name = value == 1 ? unit.to_s.singularize : unit.to_s
68
68
  "#{value} #{unit_name}"
69
69
  }.to_sentence
@@ -55,7 +55,7 @@
55
55
  html: '<div id="%{id}" class="h-full w-full">%{loading}</div>',
56
56
  content_for: nil,
57
57
  donut: true,
58
- colors: ["#4F46E5", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#EC4899", "#06B6D4", "#84CC16"] %>
58
+ colors: ["#4F46E5", "#10B981", "#F59E0B", "#EF4444", "#8B5CF6", "#EC4899", "#06B6D4", "#84CC16", "#64748B", "#92400E"] %>
59
59
  <% else %>
60
60
  <div class="flex items-center justify-center h-full text-gray-500">
61
61
  No events to display
@@ -11,7 +11,7 @@
11
11
  <% end %>
12
12
  </h1>
13
13
  <div class="text-sm text-gray-500">
14
- <%= @pagination.count %> events
14
+ <%= number_with_delimiter(@pagination.count) %> events
15
15
  </div>
16
16
  </div>
17
17
 
@@ -97,8 +97,8 @@
97
97
  <div class="px-6 py-4">
98
98
  <dt class="text-sm font-medium text-gray-500">Source Location</dt>
99
99
  <dd class="mt-1 text-sm text-gray-900">
100
- <code class="bg-gray-100 px-2 py-1 rounded text-xs break-all">
101
- <%= filepath %>:<%= @event[:source_line] %>
100
+ <code class="bg-gray-100 px-2 py-1 rounded text-xs break-all" title="<%= filepath %>">
101
+ <%= event_short_filepath(@event) %>:<%= @event[:source_line] %>
102
102
  </code>
103
103
  <% label = @event[:source_label] %>
104
104
  <% if label.present? %>
@@ -64,8 +64,12 @@
64
64
  +<%= (offset * 1000).round %>ms
65
65
  <% elsif offset < 60 %>
66
66
  +<%= offset.round(1) %>s
67
+ <% elsif offset < 1.hour %>
68
+ +<%= (offset / 1.minute).round %>m
69
+ <% elsif offset < 1.day %>
70
+ +<%= (offset / 1.hour).round %>h
67
71
  <% else %>
68
- +<%= (offset / 60).round %>m
72
+ +<%= (offset / 1.day).round %>d
69
73
  <% end %>
70
74
  </span>
71
75
  </div>
@@ -1,3 +1,3 @@
1
1
  module RailsEventViewer
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_event_viewer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keshav Biswa