Permalink
Browse files

save benchmark script now reports hypertable write latency

  • Loading branch information...
1 parent cb6a4ca commit 9d57aa017f6f57dd2bb9f26bea175f530ff82602 @tylerkovacs committed Mar 27, 2009
Showing with 16 additions and 4 deletions.
  1. +16 −4 benchmark/save.rb
View
@@ -1,12 +1,16 @@
require File.join(File.dirname(__FILE__), '../spec/spec_helper.rb')
# Results with flush_interval=10
-# 1000 save requests in 11.829525 sec: 84.5342479938966 r/s
-# 1000 save_with_mutator requests in 1.781124 sec: 561.443223492581 r/s
+# 1000 save requests in 14.879574 sec: 67.2062251244559 r/s
+# hypertable write latency was 13.632525
+# 1000 save_with_mutator requests in 1.624659 sec: 615.513778583691 r/s
+# hypertable write latency was 0.557777
#
# Results with flush_interval=100
-# 1000 save requests in 13.218057 sec: 75.6540844089264 r/s
-# 1000 save_with_mutator requests in 0.990271 sec: 1009.82458337162 r/s
+# 1000 save requests in 13.127422 sec: 76.1764191019379 r/s
+# hypertable write latency was 11.971095
+# 1000 save_with_mutator requests in 0.886474 sec: 1128.06466969138 r/s
+# hypertable write latency was 0.454088000000001
class Bench < ActiveRecord::HyperBase
def self.create_table
@@ -28,7 +32,11 @@ def self.create_table
record.save!
end
ts1 = Time.now - t1
+
+read_latency, write_latency, cells_read = ActiveRecord::ConnectionAdapters::HypertableAdapter.get_timing
+ActiveRecord::ConnectionAdapters::HypertableAdapter.reset_timing
puts "#{n} save requests in #{ts1} sec: #{n/ts1} r/s"
+puts " hypertable write latency was #{write_latency}"
Bench.drop_table if Bench.table_exists?
Bench.create_table
@@ -43,4 +51,8 @@ def self.create_table
end
Bench.close_mutator(m)
ts2 = Time.now - t2
+
+read_latency, write_latency, cells_read = ActiveRecord::ConnectionAdapters::HypertableAdapter.get_timing
+ActiveRecord::ConnectionAdapters::HypertableAdapter.reset_timing
puts "#{n} save_with_mutator requests in #{ts2} sec: #{n/ts2} r/s"
+puts " hypertable write latency was #{write_latency}"

0 comments on commit 9d57aa0

Please sign in to comment.