<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,8 +1,7 @@
-0.6.1 (2008-06-13)
+0.6.1 (2008-02-25)
 ========================
 
-ruby-prof 0.6.1 add support for profiling tests cases and a
-benchmarking mode.
+ruby-prof 0.6.1 add support for profiling tests cases. 
 
 Features
 --------
@@ -33,14 +32,8 @@ Features
 * Used the new support for profiling test cases to revamp
   the way that Rails profiling works.  For more information
   please refer to RubyProf's documentation.
-
-* Added benchmarking mode which measures total between start
-  and stop but disables profiling. This allows you to benchmark
-  already-instrumented code instead of profiling it with the flip
-  of a a switch: RubyProf.benchmarking = true. RubyProf.stop will
-  return a float total_time instead of a profile result.
-
-
+  
+  
 Fixes
 -------
 * RubyProf.profile no longer crashes if an exception is</diff>
      <filename>CHANGES</filename>
    </modified>
    <modified>
      <diff>@@ -159,10 +159,6 @@ static st_table *threads_tbl = NULL;
    a separate stack since this isn't thread safe! */
 static thread_data_t* last_thread_data = NULL;
 
-static int benchmarking_mode = 0;
-static prof_measure_t bench_mark_time;
-static prof_measure_t bench_total_time;
-
 
 /* ================  Helper Functions  =================*/
 /* Helper method to get the id of a Ruby thread. */
@@ -1448,46 +1444,6 @@ prof_set_measure_mode(VALUE self, VALUE val)
     return val;
 }
 
-/* call-seq:
-   benchmarking? -&gt; boolean
-
-Returns whether benchmarking mode is enabled.*/
-static VALUE
-prof_get_benchmarking_mode(VALUE self)
-{
-    if (benchmarking_mode)
-        return Qtrue;
-    else
-        return Qfalse;
-}
-
-/* call-seq:
-   benchmarking=value -&gt; void
-
-Enable benchmarking mode. Measure total time only, no profiling.*/
-static VALUE
-prof_set_benchmarking_mode(VALUE self, VALUE val)
-{
-    if (threads_tbl)
-    {
-      rb_raise(rb_eRuntimeError, &quot;can't set measure_mode while profiling&quot;);
-    }
-
-    benchmarking_mode = (val == Qfalse || val == Qnil) ? 0 : 1;
-    return val;
-}
-
-/* call-seq:
-   total_time -&gt; float
-
-Returns the total time spent. */
-static VALUE
-prof_get_bench_total_time(VALUE self)
-{
-    return rb_float_new(convert_measurement(bench_total_time));
-}
-
-
 /* =========  Profiling ============= */
 void
 prof_install_hook()
@@ -1542,23 +1498,17 @@ prof_running(VALUE self)
 static VALUE
 prof_start(VALUE self)
 {
-    /* Setup globals. Reset benchmark. */
-    if (threads_tbl == NULL)
+    if (threads_tbl != NULL)
     {
-        last_thread_data = NULL;
-        threads_tbl = threads_table_create();
-        bench_total_time = 0;
+        rb_raise(rb_eRuntimeError, &quot;RubyProf.start was already called&quot;);
     }
 
-    /* Begin benchmark. */
-    bench_mark_time = get_measurement();
-
-    /* Install event hook unless benchmarking only. */
-    if (!benchmarking_mode)
-      prof_install_hook();
-
+    /* Setup globals */
+    last_thread_data = NULL;
+    threads_tbl = threads_table_create();
+    prof_install_hook();              
     return self;
-}
+}    
 
 /* call-seq:
    pause -&gt; RubyProf
@@ -1567,40 +1517,37 @@ prof_start(VALUE self)
 static VALUE
 prof_pause(VALUE self)
 {
-    prof_measure_t last;
-
     if (threads_tbl == NULL)
     {
         rb_raise(rb_eRuntimeError, &quot;RubyProf is not running.&quot;);
     }
 
-    /* Add to benchmark total. */
-    last = bench_mark_time;
-    bench_mark_time = get_measurement();
-    bench_total_time += bench_mark_time - last;
-
-    /* Remove event hook unless benchmarking only. */
-    if (!benchmarking_mode)
-      prof_remove_hook();
-
+    prof_remove_hook();
     return self;
 }
 
 /* call-seq:
-   resume {block} -&gt; float
+   resume {block} -&gt; RubyProf
    
    Resumes recording profile data.*/
 static VALUE
 prof_resume(VALUE self)
 {
-    prof_start(self);
-
+    if (threads_tbl == NULL)
+    { 
+        prof_start(self);
+    }
+    else
+    { 
+        prof_install_hook();
+    }
+    
     if (rb_block_given_p())
     {
       rb_ensure(rb_yield, self, prof_pause, self);
     }
 
-    return prof_get_bench_total_time(self);
+    return self;
 }
 
 /* call-seq:
@@ -1611,12 +1558,11 @@ static VALUE
 prof_stop(VALUE self)
 {
     VALUE result = Qnil;
+    
+    prof_remove_hook();
 
-    prof_pause(self);
-
-    /* Create the result unless benchmarking only */
-    if (!benchmarking_mode)
-      result = prof_result_new();
+    /* Create the result */
+    result = prof_result_new();
 
     /* Unset the last_thread_data (very important!) 
        and the threads table */
@@ -1624,8 +1570,7 @@ prof_stop(VALUE self)
     threads_table_free(threads_tbl);
     threads_tbl = NULL;
 
-    /* Return the result if profiling or total time if benchmarking only */
-    return (benchmarking_mode ? prof_get_bench_total_time(self) : result);
+    return result;
 }
 
 /* call-seq:
@@ -1636,7 +1581,7 @@ static VALUE
 prof_profile(VALUE self)
 {
     int result;
-
+    
     if (!rb_block_given_p())
     {
         rb_raise(rb_eArgError, &quot;A block must be provided to the profile method.&quot;);
@@ -1663,14 +1608,10 @@ Init_ruby_prof()
     rb_define_module_function(mProf, &quot;pause&quot;, prof_pause, 0);
     rb_define_module_function(mProf, &quot;running?&quot;, prof_running, 0);
     rb_define_module_function(mProf, &quot;profile&quot;, prof_profile, 0);
-
+    
     rb_define_singleton_method(mProf, &quot;measure_mode&quot;, prof_get_measure_mode, 0);
     rb_define_singleton_method(mProf, &quot;measure_mode=&quot;, prof_set_measure_mode, 1);
 
-    rb_define_singleton_method(mProf, &quot;benchmarking?&quot;, prof_get_benchmarking_mode, 0);
-    rb_define_singleton_method(mProf, &quot;benchmarking=&quot;, prof_set_benchmarking_mode, 1);
-    rb_define_singleton_method(mProf, &quot;total_time&quot;, prof_get_bench_total_time, 0);
-
     rb_define_const(mProf, &quot;CLOCKS_PER_SEC&quot;, INT2NUM(CLOCKS_PER_SEC));
     rb_define_const(mProf, &quot;PROCESS_TIME&quot;, INT2NUM(MEASURE_PROCESS_TIME));
     rb_define_singleton_method(mProf, &quot;measure_process_time&quot;, prof_measure_process_time, 0); /* in measure_process_time.h */</diff>
      <filename>ext/ruby_prof.c</filename>
    </modified>
    <modified>
      <diff>@@ -4,7 +4,6 @@ require 'ruby-prof'
 module RubyProf
   module Test
     PROFILE_OPTIONS = {
-      :benchmarking =&gt; false,
       :measure_modes =&gt; [RubyProf::PROCESS_TIME],
       :count =&gt; 10,
       :printers =&gt; [RubyProf::FlatPrinter, RubyProf::GraphHtmlPrinter],
@@ -64,7 +63,6 @@ module RubyProf
     end
 
     def run_profile(measure_mode)
-      RubyProf.benchmarking = PROFILE_OPTIONS[:benchmarking]
       RubyProf.measure_mode = measure_mode
 
       print '  '
@@ -85,17 +83,11 @@ module RubyProf
       end
 
       data = RubyProf.stop
-
-      bench =
-        if RubyProf.benchmarking?
-          data
-        else
-          data.threads.values.inject(0) do |total, method_infos|
-            top = method_infos.sort.last
-            total += top.total_time
-            total
-          end
-        end
+      bench = data.threads.values.inject(0) do |total, method_infos|
+        top = method_infos.sort.last
+        total += top.total_time
+        total
+      end
 
       puts &quot;\n  #{measure_mode_name(measure_mode)}: #{format_profile_total(bench, measure_mode)}\n&quot;
 
@@ -116,31 +108,14 @@ module RubyProf
     end
 
     def report_profile(data, measure_mode)
-      if RubyProf.benchmarking?
-        bench_filename = &quot;#{PROFILE_OPTIONS[:output_dir]}/benchmarks.csv&quot;
-        new_file = !File.exist?(bench_filename)
+      PROFILE_OPTIONS[:printers].each do |printer_klass|
+        printer = printer_klass.new(data)
 
-        File.open(bench_filename, 'ab') do |file|
-          if new_file
-            file.puts 'test,metric,measurement,runs,ruby_engine,ruby_version,ruby_patchlevel,ruby_platform,created_at'
-          end
-
-          file.puts [&quot;#{self.class.name}##{method_name}&quot;, measure_mode_name(measure_mode),
-            data, PROFILE_OPTIONS[:count],
-            defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby',
-            RUBY_VERSION, RUBY_PATCHLEVEL, RUBY_PLATFORM,
-            Time.now.utc.xmlschema].join(',')
-        end
-      else
-        PROFILE_OPTIONS[:printers].each do |printer_klass|
-          printer = printer_klass.new(data)
+        # Open the file
+        file_name = report_filename(printer, measure_mode)
 
-          # Open the file
-          file_name = report_filename(printer, measure_mode)
-
-          File.open(file_name, 'wb') do |file|
-            printer.print(file, PROFILE_OPTIONS)
-          end
+        File.open(file_name, 'wb') do |file|
+          printer.print(file, PROFILE_OPTIONS)
         end
       end
     end</diff>
      <filename>lib/ruby-prof/profile_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -65,19 +65,16 @@ class BasicTest &lt; Test::Unit::TestCase
   
   def test_double_profile
     RubyProf.start
-    assert_nothing_raised do
+    assert_raise(RuntimeError) do
       RubyProf.start
     end
-
-    assert_nothing_raised do
+    
+    assert_raise(RuntimeError) do
       RubyProf.profile do
         puts 1
       end
     end
-
-    assert_raise(RuntimeError) do
-      RubyProf.stop
-    end
+    RubyProf.stop
   end
   
   def test_no_block</diff>
      <filename>test/basic_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/benchmarking_test.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>56699e5624d2be8588655af4c0a508c6a29ee66b</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </author>
  <url>http://github.com/jeremy/ruby-prof/commit/67153856b52537e44a37b33eac32b63991a6939f</url>
  <id>67153856b52537e44a37b33eac32b63991a6939f</id>
  <committed-date>2008-06-15T14:29:58-07:00</committed-date>
  <authored-date>2008-06-15T14:11:43-07:00</authored-date>
  <message>Revert &quot;Introduce benchmarking mode. Do time, memory, and allocation benchmarks with the same code you've already written for profiling.&quot;

This reverts commit a43ce84ceecb294d74f9bee94127e739a9b3b438.</message>
  <tree>d95567730b08b26a8ada1035cc1cbcf98d49076b</tree>
  <committer>
    <name>Jeremy Kemper</name>
    <email>jeremy@bitsweat.net</email>
  </committer>
</commit>
