log_bench 0.5.0 → 0.5.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 +4 -4
- data/lib/log_bench/app/renderer/details.rb +16 -0
- data/lib/log_bench/log/parser.rb +12 -1
- data/lib/log_bench/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c16c232332f3594f9e7d651a3ee85a5727030c0d4f903b0ebc6b3c1658943e08
|
|
4
|
+
data.tar.gz: 19554a7cf8a893be6c6d7317a62c3cf561014ed75771a4bffaec7090b5c1ef21
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d2fc425a9740acd833de171e45ef1f9c9ed1a07b352ac9ddbae66d344d806e313e77e1176ef51026a6167dff6e6146d3dbf8e4f1b868a66d40dd3d71a12e4b3
|
|
7
|
+
data.tar.gz: 4763e264ac27482fad2f5062b7eba0fa95066784a4c7b41f55902b000692488c5f6067284d88d06333b833bfb1760b6864d2f41c5bc299bc4a89f64887fc40d1
|
|
@@ -193,6 +193,8 @@ module LogBench
|
|
|
193
193
|
entry_id += 1
|
|
194
194
|
add_request_id_lines(lines, request, entry_id)
|
|
195
195
|
entry_id += 1
|
|
196
|
+
add_request_timestamp_lines(lines, request, entry_id)
|
|
197
|
+
entry_id += 1
|
|
196
198
|
add_params_lines(lines, request, max_width, entry_id)
|
|
197
199
|
entry_id += 1
|
|
198
200
|
add_related_logs_section(lines, request, entry_id)
|
|
@@ -378,6 +380,20 @@ module LogBench
|
|
|
378
380
|
screen.color_pair(n)
|
|
379
381
|
end
|
|
380
382
|
|
|
383
|
+
def add_request_timestamp_lines(lines, request, entry_id)
|
|
384
|
+
if request.timestamp
|
|
385
|
+
lines << {
|
|
386
|
+
text: "Timestamp: #{request.timestamp.strftime("%Y-%m-%d %H:%M:%S UTC")}",
|
|
387
|
+
color: nil,
|
|
388
|
+
entry_id: entry_id,
|
|
389
|
+
segments: [
|
|
390
|
+
{text: "Timestamp: ", color: color_pair(1)},
|
|
391
|
+
{text: request.timestamp.strftime("%Y-%m-%d %H:%M:%S UTC"), color: nil} # Default white color
|
|
392
|
+
]
|
|
393
|
+
}
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
|
|
381
397
|
def detail_win
|
|
382
398
|
screen.detail_win
|
|
383
399
|
end
|
data/lib/log_bench/log/parser.rb
CHANGED
|
@@ -113,7 +113,18 @@ module LogBench
|
|
|
113
113
|
return unless entry.is_a?(JobEnqueueEntry)
|
|
114
114
|
return unless defined?(App::State)
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
# If entry has a request_id, use it directly
|
|
117
|
+
request_id = entry.request_id
|
|
118
|
+
|
|
119
|
+
# If no request_id, check if this enqueue happened inside another job
|
|
120
|
+
# by looking at the tags to find the parent job's request_id
|
|
121
|
+
if !request_id && entry.respond_to?(:json_data)
|
|
122
|
+
tags = entry.json_data["tags"]
|
|
123
|
+
parent_job_id, _parent_job_class = extract_job_info_from_tags(tags)
|
|
124
|
+
request_id = App::State.instance.request_id_for_job(parent_job_id) if parent_job_id
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
App::State.instance.register_job_enqueue(entry.job_id, request_id)
|
|
117
128
|
end
|
|
118
129
|
|
|
119
130
|
# Enrich job execution logs with request_id and colored prefix
|
data/lib/log_bench/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: log_bench
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Benjamín Silva
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-
|
|
10
|
+
date: 2025-11-06 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: zeitwerk
|