summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAleksei Lipniagov <alipniagov@gitlab.com>2019-07-12 10:44:17 +0000
committerKamil TrzciƄski <ayufan@ayufan.eu>2019-07-12 10:44:17 +0000
commit4085428ebd92be5fa5cd972876a349203c9bb5db (patch)
treea30cb19cf4fad51405e3d7dc34091cebb00eab09 /scripts
parent1def071991dddf6a1500c84d9e53a0edd64d45a1 (diff)
downloadgitlab-ce-4085428ebd92be5fa5cd972876a349203c9bb5db.tar.gz
Gather memory usage data in tests
Log memory stats after running each spec file and compile the report.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gather-test-memory-data21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/gather-test-memory-data b/scripts/gather-test-memory-data
new file mode 100755
index 00000000000..9992a83e6a6
--- /dev/null
+++ b/scripts/gather-test-memory-data
@@ -0,0 +1,21 @@
+#!/usr/bin/env ruby
+
+require 'csv'
+
+def join_csv_files(output_path, input_paths)
+ return if input_paths.empty?
+
+ input_csvs = input_paths.map do |input_path|
+ CSV.read(input_path, headers: true)
+ end
+
+ CSV.open(output_path, "w", headers: input_csvs.first.headers, write_headers: true) do |output_csv|
+ input_csvs.each do |input_csv|
+ input_csv.each do |line|
+ output_csv << line
+ end
+ end
+ end
+end
+
+join_csv_files('tmp/memory_test/report.csv', Dir['tmp/memory_test/*.csv'].sort)