lib/showoff.rb in showoff-0.9.7 vs lib/showoff.rb in showoff-0.9.7.1
- old
+ new
@@ -680,11 +680,13 @@
end
@all = Hash.new
@@counter.each do |slide, stats|
@all[slide] = 0
- stats.map { |host, count| @all[slide] += count }
+ stats.map do |host, visits|
+ visits.each { |entry| @all[slide] += entry['elapsed'].to_f }
+ end
end
# most and least five viewed slides
@least = @all.sort_by {|slide, time| time}[0..4]
@most = @all.sort_by {|slide, time| -time}[0..4]
@@ -900,10 +902,10 @@
# a bucket for this slide
@@counter[slide] ||= Hash.new
# a bucket of slideviews for this address
@@counter[slide][remote] ||= Array.new
# and add this slide viewing to the bucket
- @@counter[slide][remote] << { :elapsed => time, :timestamp => Time.now.to_i, :presenter => @@current[:name] }
+ @@counter[slide][remote] << { 'elapsed' => time, 'timestamp' => Time.now.to_i, 'presenter' => @@current[:name] }
when 'position'
ws.send( { 'current' => @@current[:number] }.to_json ) unless @@cookie.nil?
when 'pace', 'question'