Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/rspec_run_time.rb')
-rw-r--r--spec/support/rspec_run_time.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/support/rspec_run_time.rb b/spec/support/rspec_run_time.rb
index 977d4885624..2cfa4008fd3 100644
--- a/spec/support/rspec_run_time.rb
+++ b/spec/support/rspec_run_time.rb
@@ -87,7 +87,8 @@ module Support
unless @last_elapsed_seconds.nil? || elapsed_seconds - @last_elapsed_seconds < 1
output.puts \
"# [RSpecRunTime] RSpec elapsed time: #{readable_duration(elapsed_seconds)}. " \
- "#{current_rss_in_megabytes}\n\n"
+ "#{current_rss_in_megabytes}. " \
+ "#{load_average}\n\n"
end
@last_elapsed_seconds = elapsed_seconds
@@ -98,6 +99,14 @@ module Support
"Current RSS: ~#{rss_in_megabytes.round}M"
end
+
+ def load_average
+ if File.exist?('/proc/loadavg')
+ "load average: #{File.read('/proc/loadavg')}"
+ else
+ `uptime`[/(load average:[^\n]+)/, 1] || '(uptime failed)'
+ end
+ end
end
end
end