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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e895ebdfdf2cfb2a09dc6771092b2df4128994657b888ca2f1c9fa0abd8e707
4
- data.tar.gz: 3440ad80cde5de22eae7888543c7db28338e669ff5461b360afa762d7477c3d9
3
+ metadata.gz: eca52a3033991940801e322766760fd9c6f80bf59a7f0556459583cd062842d8
4
+ data.tar.gz: c33e9ecc4c1cca39e5d22ece05f4d3fc6d8b6b76da0d8ff2d2bd1fd383c0ba25
5
5
  SHA512:
6
- metadata.gz: 4dc6fc31f2398e95f191af9b9704ae542ff60e71dd03dafa8fd93bd3f563b11d78ce9293e288319b6ecd66b11452278fb9e72ab868f3507bf6f085a58d8c3a91
7
- data.tar.gz: 54cb6c4879c49ab1196a089e8fbd4632b72e3c2c5077c4c1918b5d8365c105d18a27d2334068fca8024e249f8df9c4a7d4e41f8a2a9b89e238ab8cb396f9606b
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-18
3
+ ## [0.2.1] - 2025-01-29
4
4
 
5
- - Multline log support
6
- - Bug fix
7
- - Refine stats
8
- - Refectoring
9
- - Add tests
5
+ - Ignore other tags on scanning logs
10
6
 
11
- ## [0.2.0] - 2024-12-15
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 from Rails log files.
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
- It can be used during development to identify bottlenecks in the application or for small-scale benchmarking.
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
- The following extraction criteria can be specified:
9
+ ## Features
8
10
 
9
- * Request ID
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
- * Request date and time range
18
+ * Date and time range of the request
13
19
  * Response time range
14
- * String matching
20
+ * String matching within logs
15
21
 
16
- The extracted logs can be formatted and output in the following formats:
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
- Additionally, the tool can aggregate and output metrics such as response times for the extracted requests:
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 /\AStarted (?<http_method>\S+) "(?<path>[^"]*)" for (?<client>\S+)/ =~ message
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 /\AProcessing by (?<controller>[^\s#]+)#(?<action>\S+)/ =~ message
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 /\ACompleted (?<http_status>\d+) .* in (?<duration>\d+)ms \((?<durations>.*)\)/ =~ message
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+)?)/)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SelectRailsLog
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
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.0
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-18 00:00:00.000000000 Z
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: select_rails_log is a tool for extracting request logs from Rails log
55
- files.
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 log selector
130
+ summary: A tool for extracting, formatting, and analyzing Rails logs
131
131
  test_files: []