Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
BuonOmo committed Jan 22, 2025
1 parent 41aaadc commit fc0ae40
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,9 @@ jobs:
cat ${{ github.workspace }}/setup.sql | cockroach sql --insecure
- name: Test
run: AR_LOG=summary bundle exec rake test TESTOPTS='--profile=5 --verbose'
- name: Upload queries file
uses: actions/upload-artifact@v3
- name: Upload test information
uses: actions/upload-artifact@v4
if: always()
with:
name: query_time.json
path: tmp/query_time.json
- name: Upload stackprof dump
uses: actions/upload-artifact@v3
if: always()
with:
name: stackprof.dump
path: tmp/stackprof.dump
name: crdb-${{ matrix.crdb }}_ruby-${{ matrix.ruby }})_test_information
path: tmp/*
2 changes: 1 addition & 1 deletion bin/start-cockroachdb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ die() { echo "$0: $*" 1>&2 ; false; }

root_dir="$(dirname $(dirname "$0:A"))"
pid_file="$root_dir/tmp/cockroach.pid"
log_file="$root_dir/tmp/cockroachdb.log"
log_file="$root_dir/tmp/cockroach.log"

mkdir -p "$root_dir/tmp"
[[ -f "$pid_file" ]] && kill -9 $(cat "$pid_file") || true
Expand Down
3 changes: 2 additions & 1 deletion test/cases/helper_cockroachdb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,6 @@ class BaseCompatibilityTest < ActiveRecord::TestCase
end

require "stackprof"
StackProf.start(mode: :wall, interval: 1000)
FileUtils.mkdir_p("tmp")
StackProf.start(mode: :wall, interval: 1000, out: "tmp/stackprof.dump")
Minitest.after_run { StackProf.stop; StackProf.results("tmp/stackprof.dump") }
4 changes: 2 additions & 2 deletions test/support/sql_logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def summary_log
time = detail.values.sum { |(total, _, _)| total } / 1_000
count = detail.values.sum { |(_, _, count)| count }
puts "Total time spent in SQL: #{time}s (#{count} queries)"
puts "Detail per query kind available in tmp/query_time.json (total time in ms, avg time in ms, query count). Sorted by avg time."
puts "Detail per query kind available in #{Dir.pwd}/tmp/query_time.json (total time in ms, avg time in ms, query count). Sorted by avg time."
File.write(
"tmp/query_time.json",
Dir.pwd + "/tmp/query_time.json",
JSON.pretty_generate(detail)
)
}
Expand Down

0 comments on commit fc0ae40

Please sign in to comment.