Skip to content

Commit a09a87d

Browse files
committed
test
1 parent 0fe2427 commit a09a87d

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
strategy:
4040
matrix:
41-
crdb: [v23.1.11]
41+
crdb: [v23.1.15]
4242
ruby: [head]
4343
name: Test (crdb=${{ matrix.crdb }} ruby=${{ matrix.ruby }})
4444
steps:
@@ -95,4 +95,12 @@ jobs:
9595
SET CLUSTER SETTING sql.defaults.experimental_temporary_tables.enabled = 'true';
9696
"
9797
- 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

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2.1
1+
3.2.3

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source "https://rubygems.org"
44

55
gemspec
66

7+
gem "minitest-stackprof"
78

89
module RailsTag
910
class << self

test/cases/helper_cockroachdb.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,14 @@ def header(stream)
176176
end
177177

178178
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

0 commit comments

Comments
 (0)