rails-profiler 0.30.0 → 0.30.1

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: fcc4a5ad4cdedde3dd6427df52aeb75a54c4c8e973e0816f5f3d71e958042a89
4
- data.tar.gz: b4f2c42db2a3a4fd0d1afd3648dcde087284dd3cf35aef0bca86049a832f3f71
3
+ metadata.gz: ef4a54cfcda2a485105a2adaaecdf2745f98dd12039ff47ff3e448a1ed6fb050
4
+ data.tar.gz: ac60b2c9103112ff2a7620df3fbe95b07aded1856662948666caca556224218b
5
5
  SHA512:
6
- metadata.gz: 3e0083dfee931dcc4e1d13eff5e873cd18eb24a8853ce503b57a38e4ec7bd3d32862e4298cf8a4cc100ee4b47863eb715a0317488e41b0b9e228127d7fcd62fd
7
- data.tar.gz: 8eabcaefdfeaf5fd5fbc0149aacb179dd139b05c92157fa48708484e140c868c36869c3d03023ffcfc7603f318fde2e156ef292ca1265406d176de591c832d64
6
+ metadata.gz: 733cd3aed684f390a3e8dd7656a08f94f29c00e45c42f128c5b8369cbc9d2f5db763b7bcb59e1870114853c74c8e8dd4f3e8f022c326310e3c2ad1cd9c3ba3c5
7
+ data.tar.gz: bd0361ba931f6139527db2fd02c8f6518ff19ac82dde78758c7b86ed590c342cfc659ef9c60cc6240949a54d1ec7f42d573a1d0952002028d23a0b9e68477cbc
@@ -5554,18 +5554,19 @@
5554
5554
  };
5555
5555
  };
5556
5556
  const [section, setSection] = d2(initialSection);
5557
- const infiniteOpts = (key) => ({
5557
+ const infiniteOpts = (key, fetchFn) => ({
5558
5558
  query: {
5559
5559
  enabled: section === key,
5560
+ queryFn: ({ pageParam = 0, signal }) => fetchFn(pageParam, signal),
5560
5561
  getNextPageParam: (lastPage) => lastPage.has_more ? lastPage.offset + lastPage.limit : void 0,
5561
5562
  initialPageParam: 0,
5562
5563
  refetchOnWindowFocus: false
5563
5564
  }
5564
5565
  });
5565
- const httpQuery = useListProfilesInfinite({ limit: 50 }, infiniteOpts("http"));
5566
- const jobsQuery = useListJobsInfinite({ limit: 50 }, infiniteOpts("jobs"));
5567
- const consolesQuery = useListConsolesInfinite({ limit: 50 }, infiniteOpts("console"));
5568
- const testsQuery = useListTestsInfinite({ limit: 50 }, infiniteOpts("tests"));
5566
+ const httpQuery = useListProfilesInfinite({ limit: 50 }, infiniteOpts("http", (offset, signal) => listProfiles({ limit: 50, offset }, signal)));
5567
+ const jobsQuery = useListJobsInfinite({ limit: 50 }, infiniteOpts("jobs", (offset, signal) => listJobs({ limit: 50, offset }, signal)));
5568
+ const consolesQuery = useListConsolesInfinite({ limit: 50 }, infiniteOpts("console", (offset, signal) => listConsoles({ limit: 50, offset }, signal)));
5569
+ const testsQuery = useListTestsInfinite({ limit: 50 }, infiniteOpts("tests", (offset, signal) => listTests({ limit: 50, offset }, signal)));
5569
5570
  const outboundQuery = useListOutboundRequests({ query: { enabled: section === "outbound", refetchOnWindowFocus: false } });
5570
5571
  const envQuery = useGetEnvVars({ query: { enabled: section === "env", refetchOnWindowFocus: false } });
5571
5572
  const { mutateAsync: deleteProfileMutation } = useDeleteProfile();
@@ -80,7 +80,8 @@ module Profiler
80
80
 
81
81
  def request(uri, req)
82
82
  resp = Net::HTTP.start(uri.hostname, uri.port,
83
- open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT) do |http|
83
+ open_timeout: OPEN_TIMEOUT, read_timeout: READ_TIMEOUT,
84
+ use_ssl: uri.scheme == "https") do |http|
84
85
  http.request(req)
85
86
  end
86
87
  return {} if resp.code == "204"
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../slave_support"
4
+ require_relative "../../env_override_store"
4
5
 
5
6
  module Profiler
6
7
  module MCP
@@ -83,7 +84,7 @@ module Profiler
83
84
  return "No overrides active." if overrides.empty?
84
85
 
85
86
  rows = overrides.map do |key, entry|
86
- current = entry["value"] == "__PROFILER_DELETED__" ? "(deleted)" : entry["value"]
87
+ current = entry["value"] == Profiler::EnvOverrideStore::DELETED_SENTINEL ? "(deleted)" : entry["value"]
87
88
  "| #{key} | #{current} | #{entry["original"] || "(unset)"} |"
88
89
  end
89
90
  "**Active ENV overrides (#{overrides.size})**\n\n| Key | Current Value | Original Value |\n|-----|--------------|----------------|\n" + rows.join("\n")
@@ -73,11 +73,11 @@ module Profiler
73
73
 
74
74
  row = fields.map do |f|
75
75
  case f
76
- when "time" then profile.started_at.strftime("%H:%M:%S")
76
+ when "time" then profile.started_at&.strftime("%H:%M:%S") || "-"
77
77
  when "expression" then console_data["expression"].to_s.then { |e| e.length > 60 ? "#{e[0, 57]}..." : e }
78
78
  when "return_value" then console_data["return_value"].to_s.then { |v| v.length > 80 ? "#{v[0, 77]}..." : v }
79
79
  when "status" then profile.status == 200 ? "completed" : "failed"
80
- when "duration" then "#{profile.duration.round(2)}ms"
80
+ when "duration" then profile.duration ? "#{profile.duration.round(2)}ms" : "-"
81
81
  when "queries" then db_data["total_queries"].to_i.to_s
82
82
  when "token" then profile.token.to_s
83
83
  end
@@ -62,11 +62,11 @@ module Profiler
62
62
  job_data = profile.collector_data("job") || {}
63
63
  row = fields.map do |f|
64
64
  case f
65
- when "time" then profile.started_at.strftime("%H:%M:%S")
65
+ when "time" then profile.started_at&.strftime("%H:%M:%S") || "-"
66
66
  when "job_class" then job_data["job_class"] || profile.path
67
67
  when "queue" then job_data["queue"] || "-"
68
68
  when "status" then job_data["status"] || "-"
69
- when "duration" then "#{profile.duration.round(2)}ms"
69
+ when "duration" then profile.duration ? "#{profile.duration.round(2)}ms" : "-"
70
70
  when "gem_version"
71
71
  v = profile.gem_version || "-"
72
72
  v != Profiler::VERSION ? "#{v} ⚠️" : v
@@ -58,11 +58,11 @@ module Profiler
58
58
 
59
59
  row = fields.map do |f|
60
60
  case f
61
- when "time" then profile.started_at.strftime("%Y-%m-%d %H:%M:%S")
61
+ when "time" then profile.started_at&.strftime("%Y-%m-%d %H:%M:%S") || "-"
62
62
  when "type" then type
63
63
  when "method" then profile.method.to_s
64
64
  when "path" then profile.path.to_s
65
- when "duration" then "#{profile.duration.round(2)}ms"
65
+ when "duration" then profile.duration ? "#{profile.duration.round(2)}ms" : "-"
66
66
  when "queries" then query_count.to_s
67
67
  when "status" then profile.status.to_s
68
68
  when "token" then profile.token.to_s
@@ -72,10 +72,10 @@ module Profiler
72
72
 
73
73
  row = fields.map do |f|
74
74
  case f
75
- when "time" then profile.started_at.strftime("%H:%M:%S")
75
+ when "time" then profile.started_at&.strftime("%H:%M:%S") || "-"
76
76
  when "test_name" then (test_data["test_name"] || profile.path).to_s.then { |n| n.length > 60 ? n[0, 57] + "..." : n }
77
77
  when "status" then test_data["status"] || "-"
78
- when "duration" then "#{profile.duration.round(2)}ms"
78
+ when "duration" then profile.duration ? "#{profile.duration.round(2)}ms" : "-"
79
79
  when "queries" then db_data["total_queries"].to_i.to_s
80
80
  when "n1" then n1_count > 0 ? "⚠ #{n1_count}" : "✓"
81
81
  when "token" then profile.token.to_s
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Profiler
4
- VERSION = "0.30.0"
4
+ VERSION = "0.30.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.30.0
4
+ version: 0.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sébastien Duplessy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-06-28 00:00:00.000000000 Z
11
+ date: 2026-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails