select_rails_log 0.2.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +8 -7
- data/README.md +18 -8
- data/lib/select_rails_log/scanner.rb +4 -4
- data/lib/select_rails_log/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eca52a3033991940801e322766760fd9c6f80bf59a7f0556459583cd062842d8
|
4
|
+
data.tar.gz: c33e9ecc4c1cca39e5d22ece05f4d3fc6d8b6b76da0d8ff2d2bd1fd383c0ba25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b48a57904026a65351bdd5a2396678dc5cc6832bd65bba75bfdfa1546360484f810453c21f82c1522371fda78445b51a66c81f6e72c91edde76c30b8b5943d4e
|
7
|
+
data.tar.gz: 1943d8809aeca176fb17220c4bd20cd14cdc207052671d65628dcc0819000db3f8a3d087265e499761290f59ffb2bb703e792da2b62d33d2ff99912664b826c9
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
## [0.2.1] - 2025-01-
|
3
|
+
## [0.2.1] - 2025-01-29
|
4
4
|
|
5
|
-
-
|
6
|
-
- Bug fix
|
7
|
-
- Refine stats
|
8
|
-
- Refectoring
|
9
|
-
- Add tests
|
5
|
+
- Ignore other tags on scanning logs
|
10
6
|
|
11
|
-
## [0.2.0] -
|
7
|
+
## [0.2.0] - 2025-01-18
|
12
8
|
|
13
9
|
- Multiple printer support
|
14
10
|
- Add printers
|
@@ -16,6 +12,11 @@
|
|
16
12
|
- tsv
|
17
13
|
- stats
|
18
14
|
- plot
|
15
|
+
- Multline log support
|
16
|
+
- Bug fix
|
17
|
+
- Refine stats
|
18
|
+
- Refectoring
|
19
|
+
- Add tests
|
19
20
|
|
20
21
|
## [0.1.0] - 2024-12-12
|
21
22
|
|
data/README.md
CHANGED
@@ -1,26 +1,36 @@
|
|
1
1
|
# select_rails_log
|
2
2
|
|
3
|
-
select_rails_log is a tool for extracting request logs
|
3
|
+
select_rails_log is a tool for parsing Rails log files and extracting request logs based on a variety of criteria.
|
4
|
+
These criteria include controller/action names, request date and time, response duration, and more.
|
4
5
|
|
5
|
-
|
6
|
+
The tool allows you to output the extracted logs in various formats and provides summary metrics such as percentiles and histograms.
|
7
|
+
It is particularly useful during development for identifying application bottlenecks or conducting small-scale benchmarking.
|
6
8
|
|
7
|
-
|
9
|
+
## Features
|
8
10
|
|
9
|
-
|
11
|
+
### Extraction Criteria
|
12
|
+
|
13
|
+
You can specify the following criteria to extract request logs:
|
14
|
+
|
15
|
+
* Request-ID
|
10
16
|
* Controller name and action name
|
11
17
|
* HTTP method and status code
|
12
|
-
*
|
18
|
+
* Date and time range of the request
|
13
19
|
* Response time range
|
14
|
-
* String matching
|
20
|
+
* String matching within logs
|
15
21
|
|
16
|
-
|
22
|
+
### Output Formats
|
23
|
+
|
24
|
+
Extracted logs can be output in the following formats:
|
17
25
|
|
18
26
|
* Text
|
19
27
|
* JSON, JSONL
|
20
28
|
* TSV
|
21
29
|
* Raw log
|
22
30
|
|
23
|
-
|
31
|
+
Summarization Options
|
32
|
+
|
33
|
+
The tool supports the following summarization features:
|
24
34
|
|
25
35
|
* Percentiles by controller and action
|
26
36
|
* Box plots by controller and action
|
@@ -53,7 +53,7 @@ module SelectRailsLog
|
|
53
53
|
ident = reqid || pid
|
54
54
|
data = prev_data = buff[ident] if buff.key?(ident)
|
55
55
|
|
56
|
-
if /\
|
56
|
+
if /\A(?:\[.*\] )?Started (?<http_method>\S+) "(?<path>[^"]*)" for (?<client>\S+)/ =~ message
|
57
57
|
buff.delete(ident)
|
58
58
|
if stop_iteration
|
59
59
|
prev_data = nil
|
@@ -88,7 +88,7 @@ module SelectRailsLog
|
|
88
88
|
log[INTERVAL] = (time && prev_time) ? time - prev_time : 0.0
|
89
89
|
prev_time = time
|
90
90
|
|
91
|
-
if /\
|
91
|
+
if /\A(?:\[.*\] )?Processing by (?<controller>[^\s#]+)#(?<action>\S+)/ =~ message
|
92
92
|
data[CONTROLLER] = controller
|
93
93
|
data[ACTION] = action
|
94
94
|
data[LOGS] << log
|
@@ -104,11 +104,11 @@ module SelectRailsLog
|
|
104
104
|
buff.delete(ident)
|
105
105
|
prev_data = nil
|
106
106
|
end
|
107
|
-
elsif /\A Parameters: (?<params>.*)/ =~ message
|
107
|
+
elsif /\A(?:\[.*\] )? Parameters: (?<params>.*)/ =~ message
|
108
108
|
data[PARAMETERS] = params
|
109
109
|
data[LOGS] << log
|
110
110
|
data[RAW_LOGS] << line if keep_raw
|
111
|
-
elsif /\
|
111
|
+
elsif /\A(?:\[.*\] )?Completed (?<http_status>\d+) .* in (?<duration>\d+)ms \((?<durations>.*)\)/ =~ message
|
112
112
|
data[HTTP_STATUS] = http_status
|
113
113
|
data[DURATION] = duration.to_i
|
114
114
|
data[PERFORMANCE] = durations.scan(/(\S+): (\d+(\.\d+)?)/)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: select_rails_log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akira yamada
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: csv
|
@@ -51,8 +51,8 @@ dependencies:
|
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: '0'
|
54
|
-
description:
|
55
|
-
|
54
|
+
description: A command-line tool for extracting, formatting, and analyzing Rails request
|
55
|
+
logs to identify performance bottlenecks and gain insights.
|
56
56
|
email:
|
57
57
|
- akira@arika.org
|
58
58
|
executables:
|
@@ -127,5 +127,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements: []
|
128
128
|
rubygems_version: 3.6.2
|
129
129
|
specification_version: 4
|
130
|
-
summary: Rails
|
130
|
+
summary: A tool for extracting, formatting, and analyzing Rails logs
|
131
131
|
test_files: []
|