<commit_before>require_relative '../test_helper'

class RackInstrumenterTest < MiniTest::Unit::TestCase
  def app
    @app ||= lambda { |env| [200, { }, [ ]] }
  end

  def test_reports_total_run_time
    instrumentor = Harness::RackInstrumenter.new app
    instrumentor.call({})

    assert_timer 'rack.request'
  end

  def test_counts_requests_per_second
    instrumentor = Harness::RackInstrumenter.new app
    instrumentor.call({})

    assert_increment 'rack.request'
  end

  def test_counts_requests_by_status_code

  end
end<commit_msg>Add test for status code gauge<commit_after>require_relative '../test_helper'

class RackInstrumenterTest < MiniTest::Unit::TestCase
  def app
    @app ||= lambda { |env| [200, { }, [ ]] }
  end

  def test_reports_total_run_time
    instrumentor = Harness::RackInstrumenter.new app
    instrumentor.call({})

    assert_timer 'rack.request'
  end

  def test_counts_requests_per_second
    instrumentor = Harness::RackInstrumenter.new app
    instrumentor.call({})

    assert_increment 'rack.request'
  end

  def test_counts_requests_by_status_code
    instrumentor = Harness::RackInstrumenter.new app
    instrumentor.call({})

    assert_increment 'rack.request.200'
  end
end
{'fraction_non_alphanumeric': 0.09706362153344208, 'fraction_numerical': 0.00734094616639478, 'mean_word_length': 4.221276595744681, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6429858', 'n_tokens_mistral': 426, 'n_tokens_neox': 410, 'n_words': 78}