File tree Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Expand file tree Collapse file tree 4 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 38
38
runs-on : ubuntu-latest
39
39
strategy :
40
40
matrix :
41
- crdb : [v23.1.11 ]
41
+ crdb : [v23.1.15 ]
42
42
ruby : [head]
43
43
name : Test (crdb=${{ matrix.crdb }} ruby=${{ matrix.ruby }})
44
44
steps :
95
95
SET CLUSTER SETTING sql.defaults.experimental_temporary_tables.enabled = 'true';
96
96
"
97
97
- name : Test
98
- run : bundle exec rake test TESTOPTS='--profile=3'
98
+ run : bundle exec rake test TESTOPTS='--profile=3 --stackprof --profile-setup'
99
+ - name : Save timing artifacts
100
+ if : ${{ always() }}
101
+ uses : actions/upload-artifact@v4
102
+ with :
103
+ name : performance
104
+ path : |
105
+ sql.ljson
106
+ stackprof-minitest-*.dump
Original file line number Diff line number Diff line change 1
- 3.2.1
1
+ 3.2.3
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ source "https://rubygems.org"
4
4
5
5
gemspec
6
6
7
+ gem "minitest-stackprof"
7
8
8
9
module RailsTag
9
10
class << self
Original file line number Diff line number Diff line change @@ -176,3 +176,14 @@ def header(stream)
176
176
end
177
177
178
178
ActiveRecord ::SchemaDumper . prepend ( NoHeaderExt )
179
+
180
+
181
+ ActiveSupport ::Notifications . subscribe 'sql.active_record' do |*args |
182
+ event = ActiveSupport ::Notifications ::Event . new ( *args )
183
+ sql = event . payload [ :sql ]
184
+ duration = event . duration # ms
185
+
186
+ File . open ( "sql.ljson" , "a" ) do |f |
187
+ f . puts JSON . dump ( { sql : sql , duration : duration } )
188
+ end
189
+ end
You can’t perform that action at this time.
0 commit comments