Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

i can't get past firewall #2

  • Loading branch information...
commit a9c48538f8b71a7734d53c3652d60871c18b6b71 1 parent 36bf99c
@evan authored
Showing with 11 additions and 2 deletions.
  1. +2 −0  CHANGELOG
  2. +9 −2 lib/bleak_house/analyzer/analyzer.rb
View
2  CHANGELOG
@@ -1,4 +1,6 @@
+v3.5. Explain when you need more frames. Build Ruby properly when `which` is missing. Slight accuracy improvement.
+
v3.4. Clearer output descriptions; work around a Marshal bug on x64; fix for missing immortal leaks.
v3.3. Build Ruby in gem install step; bundle Ruby 1.8.6 source; fixes for truncated final frames.
View
11 lib/bleak_house/analyzer/analyzer.rb
@@ -70,8 +70,13 @@ def self.run(logfile)
else
# Rebuild frames
total_frames = `grep '^-1' #{logfile} | wc`.to_i - 2
-
+
puts "#{total_frames} frames"
+
+ if total_frames < INITIAL_SKIP * 3
+ puts "Not enough frames for accurate results. Please record at least #{INITIAL_SKIP * 3} frames."
+ exit!
+ end
Ccsv.foreach(logfile) do |row|
@@ -155,8 +160,9 @@ def self.run(logfile)
puts "\n#{total_births} total births, #{total_deaths} total deaths, #{population.size} uncollected objects."
leakers = {}
-
+
# Find the sources of the leftover objects in the final population
+ frames.reverse!
population.each do |id, klass|
leaker = frames.detect do |frame|
frame['births'][id] == klass
@@ -168,6 +174,7 @@ def self.run(logfile)
leakers[tag][klass] += 1
end
end
+ frames.reverse!
# Sort
leakers = leakers.map do |tag, value|
Please sign in to comment.
Something went wrong with that request. Please try again.