diff options
author | Nick Thomas <nick@gitlab.com> | 2019-10-14 16:00:48 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-10-15 07:44:13 +0100 |
commit | 18096b5440e0818605add32538751c6be38e8343 (patch) | |
tree | b4aebac9d7f752156ee4ec3d44ee990021a1b295 /spec/gitlab_metrics_spec.rb | |
parent | 8db304b4919519bca60a5b18ffe9b88dcde845af (diff) | |
download | gitlab-shell-18096b5440e0818605add32538751c6be38e8343.tar.gz |
Remove dead Ruby code
Diffstat (limited to 'spec/gitlab_metrics_spec.rb')
-rw-r--r-- | spec/gitlab_metrics_spec.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/spec/gitlab_metrics_spec.rb b/spec/gitlab_metrics_spec.rb deleted file mode 100644 index 00e94b5..0000000 --- a/spec/gitlab_metrics_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -require_relative 'spec_helper' -require_relative '../lib/gitlab_metrics' - -describe GitlabMetrics do - describe '.measure' do - before do - $logger = double('logger').as_null_object - end - - it 'returns the return value of the block' do - val = described_class.measure('foo') { 10 } - - expect(val).to eq(10) - end - - it 'writes the metrics data to a log file' do - expect($logger).to receive(:debug). - with('metrics', a_metrics_log_message('foo')) - - described_class.measure('foo') { 10 } - end - - it 'calls proper measure methods' do - expect(described_class::System).to receive(:monotonic_time).twice.and_call_original - expect(described_class::System).to receive(:cpu_time).twice.and_call_original - - described_class.measure('foo') { 10 } - end - end -end - -RSpec::Matchers.define :a_metrics_log_message do |x| - match do |actual| - [ - actual.fetch(:name) == x, - actual.fetch(:wall_time).is_a?(Numeric), - actual.fetch(:cpu_time).is_a?(Numeric), - ].all? - end -end |