[Gridflow-cvs] [svn] commit: r3514 - /trunk/base/flow_objects.rb

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Tue Apr 15 01:21:56 EDT 2008


Author: matju
Date: Tue Apr 15 01:21:56 2008
New Revision: 3514

Log:
remove ruby [fps]

Modified:
    trunk/base/flow_objects.rb

Modified: trunk/base/flow_objects.rb
==============================================================================
--- trunk/base/flow_objects.rb (original)
+++ trunk/base/flow_objects.rb Tue Apr 15 01:21:56 2008
@@ -22,59 +22,6 @@
 =end
 module GridFlow
 GridFlow = ::GridFlow # ruby is nuts... sometimes
-
-FObject.subclass("fps",1,1) {
-	def initialize(*options)
-		super
-		@history = []   # list of delays between incoming messages
-		@last = 0.0     # when was last time
-		@duration = 0.0 # how much delay since last summary
-		@period = 1     # minimum delay between summaries
-		@detailed = false
-		@mode = :real
-		options.each {|o|
-			case o
-			when :detailed; @detailed=true
-			when :real,:user,:system,:cpu; @mode=o
-			end
-		}
-		def @history.moment(n=1)
-			sum = 0
-			each {|x| sum += x**n }
-			sum/length
-		end
-	end
-	def method_missing(*a) end # ignore non-bangs
-	def _0_period x; @period=x end
-	def publish
-		@history.sort!
-		n=@history.length
-		fps = @history.length/@duration
-		if not @detailed then send_out 0, fps; return end
-		send_out 0, fps,
-			1000*@history.min,
-			500*(@history[n/2]+ at history[(n-1)/2]),
-			1000*@history.max,
-			1000/fps,
-			1000*(@history.moment(2) - @history.moment(1)**2)**0.5
-	end
-	def _0_bang
-		t = case @mode
-		when :real; Time.new.to_f
-		when :user; Process.times.utime
-		when :system; Process.times.stime
-		when :cpu; GridFlow.rdtsc/GridFlow.cpu_hertz
-		end
-		@history.push t- at last
-		@duration += t- at last
-		@last = t
-		return if @duration<@period
-		fps = @history.length/@duration
-		publish if fps>0.001
-		@history.clear
-		@duration = 0
-	end
-}
 
 FObject.subclass("exec",1,0) {def _0_shell(*a) system(a.map!{|x| x.to_s }.join(" ")) end}
 FObject.subclass("renamefile",1,0) {def initialize; end; def _0_list(a,b) File.rename(a.to_s,b.to_s) end}



More information about the Gridflow-cvs mailing list