<commit_before>require 'spec_helper'
require 'msgpack'

describe 'CPU Sampling' do
  let(:sampling_interval_in_usec) { 1000 }

  def idle_method
    sleep 2
  end

  def find_many_square_roots
    100000.times{|x| Math.sqrt(x)}
  end

  class SampleClassForTest
    class Sample2
      def baz(block)
        instance_eval 'def zab(block) block.call end'
        [self, zab(block)]<commit_msg>Expensive idle time should idle for enough time<commit_after>require 'spec_helper'
require 'msgpack'

describe 'CPU Sampling' do
  let(:sampling_interval_in_usec) { 1000 }

  def idle_method
    sleep 3
  end

  def find_many_square_roots
    100000.times{|x| Math.sqrt(x)}
  end

  class SampleClassForTest
    class Sample2
      def baz(block)
        instance_eval 'def zab(block) block.call end'
        [self, zab(block)]
{'fraction_non_alphanumeric': 0.08292682926829269, 'fraction_numerical': 0.02926829268292683, 'mean_word_length': 3.510989010989011, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5077848', 'n_tokens_mistral': 307, 'n_tokens_neox': 272, 'n_words': 72}