rails-profiler 0.44.22 → 0.44.23
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7a25fc27ee5b1ca0d59d5e1bf5fa496e3d244d2976dd1775e8aeb7cceda94b5
|
|
4
|
+
data.tar.gz: f1acd32e7fe6767236b634eece97fd22b595efbf0404b97636c0e6e348b18cfe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 616d5117bf0b185960c00129dbc7c402b88317739ca0d9106ab786f33d8e5e6659bf2db38e995f930374815cf50459956895afe7843511217a2fcf0db2e53bba
|
|
7
|
+
data.tar.gz: 6f10a27c8cc15adac87a61460e06e7d6e98e314f10b5a713be693a475ad45cfefdee2ae7ee6726ab630a08822b7d3af2e55342539ddfd19f01a3e248e2cc13f1
|
data/CHANGELOG.md
CHANGED
|
@@ -19,6 +19,16 @@ every commit of every tag interval is accounted for one way or the other.
|
|
|
19
19
|
|
|
20
20
|
## [Unreleased]
|
|
21
21
|
|
|
22
|
+
## [0.44.23] - 2026-10-25
|
|
23
|
+
|
|
24
|
+
<!-- stamped -->
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **MCP:** `get_profile` and `get_profile_http` tools no longer crash when rendering in-flight HTTP requests with `nil` duration, safely converting to 0.0ms for comparison and display, and a `nil` status is shown as an error.
|
|
29
|
+
- **Cluster:** `SlaveProxy#request` now catches `SocketError`, `SystemCallError`, `Net::OpenTimeout`, `Net::ReadTimeout`, `OpenSSL::SSL::SSLError` and `IOError` and re-raises a `Profiler::Error` naming the slave, so a tool reading from an unreachable slave gets a normal error response instead of an internal `json-rpc` failure (matching `Peers::PeerProxy#get_json`).
|
|
30
|
+
- **Tasks:** `rake profiler:mcp` now defaults to `:stdio` transport instead of configuration-dependent behavior, aligning with the documented interface; `MCP_TRANSPORT` environment variable still overrides.
|
|
31
|
+
|
|
22
32
|
## [0.44.22] - 2026-10-25
|
|
23
33
|
|
|
24
34
|
<!-- stamped -->
|
data/lib/profiler/mcp/server.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "mcp"
|
|
4
|
+
require "net/http"
|
|
4
5
|
require_relative "http_guard"
|
|
5
6
|
|
|
6
7
|
module Profiler
|
|
@@ -467,7 +468,7 @@ module Profiler
|
|
|
467
468
|
::MCP::Tool.define(name: name, description: description, input_schema: input_schema) do |server_context: nil, **args|
|
|
468
469
|
result = handler.call(args.transform_keys(&:to_s))
|
|
469
470
|
result.is_a?(::MCP::Tool::Response) ? result : ::MCP::Tool::Response.new(result)
|
|
470
|
-
rescue Profiler::Storage::Unavailable::Error, Profiler::Error => e
|
|
471
|
+
rescue Profiler::Storage::Unavailable::Error, Profiler::Error, SystemCallError, Net::OpenTimeout, Net::ReadTimeout => e
|
|
471
472
|
::MCP::Tool::Response.new([{ type: "text", text: e.message }], error: true)
|
|
472
473
|
end
|
|
473
474
|
end
|
|
@@ -400,9 +400,10 @@ module Profiler
|
|
|
400
400
|
if http_data["requests"] && !http_data["requests"].empty?
|
|
401
401
|
lines << "### Request List"
|
|
402
402
|
http_data["requests"].each_with_index do |req, index|
|
|
403
|
-
flag = req["duration"] >= threshold ? " [SLOW]" : ""
|
|
404
|
-
|
|
405
|
-
|
|
403
|
+
flag = (req["duration"] || 0).to_f >= threshold ? " [SLOW]" : ""
|
|
404
|
+
status = req["status"].to_i
|
|
405
|
+
err = status >= 400 || status == 0 ? " [ERROR]" : ""
|
|
406
|
+
lines << "\n**#{index + 1}. #{req['method']} #{req['url']}** - #{status == 0 ? 'error' : status} - #{(req['duration'] || 0).to_f.round(2)} ms#{flag}#{err}"
|
|
406
407
|
|
|
407
408
|
if req["request_body"] && !req["request_body"].empty?
|
|
408
409
|
lines << "**Request Body:**"
|
|
@@ -76,15 +76,16 @@ module Profiler
|
|
|
76
76
|
if requests && !requests.empty?
|
|
77
77
|
lines << "## Request Details"
|
|
78
78
|
requests.each_with_index do |req, i|
|
|
79
|
-
slow_flag = req["duration"] >= threshold ? " [SLOW]" : ""
|
|
80
|
-
|
|
79
|
+
slow_flag = (req["duration"] || 0).to_f >= threshold ? " [SLOW]" : ""
|
|
80
|
+
status = req["status"].to_i
|
|
81
|
+
err_flag = status >= 400 || status == 0 ? " [ERROR]" : ""
|
|
81
82
|
lines << "\n### Request #{i + 1}#{slow_flag}#{err_flag}"
|
|
82
83
|
lines << "- **ID:** #{req['id']}" if req["id"]
|
|
83
84
|
lines << "- **Started at:** #{req['started_at']}" if req["started_at"]
|
|
84
85
|
lines << "- **Method:** #{req['method']}"
|
|
85
86
|
lines << "- **URL:** #{req['url']}"
|
|
86
|
-
lines << "- **Status:** #{
|
|
87
|
-
lines << "- **Duration:** #{req['duration'].round(2)} ms"
|
|
87
|
+
lines << "- **Status:** #{status == 0 ? 'connection error' : status}"
|
|
88
|
+
lines << "- **Duration:** #{(req['duration'] || 0).to_f.round(2)} ms"
|
|
88
89
|
lines << "- **Request Size:** #{req['request_size'].nil? ? 'unknown' : "#{'at least ' if req['request_size_is_minimum']}#{req['request_size']} bytes"}"
|
|
89
90
|
lines << "- **Response Size:** #{req['response_size']} bytes"
|
|
90
91
|
if req["request_body_not_captured"]
|
|
@@ -86,7 +86,7 @@ namespace :profiler do
|
|
|
86
86
|
task mcp: :environment do
|
|
87
87
|
require_relative "../mcp/server"
|
|
88
88
|
|
|
89
|
-
transport = ENV["MCP_TRANSPORT"]&.to_sym ||
|
|
89
|
+
transport = ENV["MCP_TRANSPORT"]&.to_sym || :stdio
|
|
90
90
|
$stderr.puts "Starting Profiler MCP server (#{transport} transport)..."
|
|
91
91
|
|
|
92
92
|
server = Profiler::MCP::Server.new
|
data/lib/profiler/version.rb
CHANGED