X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/96069fd4bf8c8ad2b8549000ad20d66b366de403..31d8469fa1adfa0c3a07a23725f26b26f2291df5:/services/api/test/helpers/time_block.rb diff --git a/services/api/test/helpers/time_block.rb b/services/api/test/helpers/time_block.rb index a3b03ff2ba..6c444e2478 100644 --- a/services/api/test/helpers/time_block.rb +++ b/services/api/test/helpers/time_block.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class ActiveSupport::TestCase def time_block label t0 = Time.now @@ -8,4 +12,16 @@ class ActiveSupport::TestCase $stderr.puts "#{t1 - t0}s #{label}" end end + + def vmpeak c + open("/proc/self/status").each_line do |line| + print "Begin #{c} #{line}" if (line =~ /^VmHWM:/) + end + n = yield + open("/proc/self/status").each_line do |line| + print "End #{c} #{line}" if (line =~ /^VmHWM:/) + end + n + end + end