Permalink
Browse files

Add files for crash reproductions.

  • Loading branch information...
0 parents commit 56bc9f75d0d2227febf20cd976f15b0267280179 @headius committed Jun 15, 2011
Showing with 303,205 additions and 0 deletions.
  1. +7 −0 README
  2. +40 −0 bench_etl.rb
  3. +1,846 −0 date.rb
  4. +1,313 −0 date/format.rb
  5. BIN jruby.jar
  6. +299,999 −0 sample_accounts.csv
7 README
@@ -0,0 +1,7 @@
+To reproduce the NoClassDefFound issue:
+
+java -jar jruby.jar --1.9 -I. bench_etl.rb
+
+To reproduce the crash:
+
+java -XX:MaxInlineSize=150 -XX:InlineSmallCode=3000 -Xbootclasspath/a:jruby.jar -Djruby.native.enabled=false org.jruby.Main -X+C --1.9 bench_etl.rb
@@ -0,0 +1,40 @@
+require 'date'
+
+start = Time.now
+#
+# Download from http://mikeperham.com/sample_accounts.csv.bz2
+#
+file = File.open("sample_accounts.csv")
+sql_file = File.new("accounts_sql.sql", "w")
+sql_file.puts "insert into mailer_account_data (account_number,amount_due, due_on, points, minimum_amount_due, available_credit,
+ last_payment, last_payment_received_on, expires_on, balance, apr) values "
+
+idx = 0
+sql_line = ""
+
+file.each_line do |line|
+ fields = line.split(',')
+
+ account_number = fields[0]
+ amount_due = sprintf('%.2f', Float(fields[1]))
+
+ due_on = Date.parse(fields[2], true)
+ points = fields[3]
+ minimum_amount_due = sprintf('%.2f', Float(fields[4]))
+ available_credit = sprintf('%.2f', Float(fields[5]))
+ last_payment = sprintf('%.2f', Float(fields[6]))
+ last_payment_received_on = Date.parse(fields[7], true)
+ expires_on = Date.parse(fields[8], true)
+ balance = sprintf('%.2f', Float(fields[9]))
+ apr = fields[10]
+
+ sql_file.puts "#{sql_line}(#{account_number},#{amount_due},'#{due_on}',#{points},#{minimum_amount_due},#{available_credit},#{last_payment},'#{last_payment_received_on}','#{expires_on}',#{balance},#{apr})"
+
+ sql_line = ","
+end
+
+sql_file.close
+
+duration = (Time.now - start).to_i
+
+puts "Transform time : #{duration.to_s}"
Oops, something went wrong.

0 comments on commit 56bc9f7

Please sign in to comment.