next up previous contents index
Next: Display Servers Up: Logs Previous: Extracting data from Logs

    
Replaying a log

Time information in the log can be used to recreate the state of the environment when the data was logged. The next example shows how to display the points logged as in Example 1.

 

Example 4  

(define (display-log dir log-file vol)
  (let ((pt #f))
   (read-log-data dir (format #f "~a-vol~a.log" log-file vol)
    (lambda (line)
      (let ((time (first line))
            (points (assoc 'points (third line)))
           )
        (when points
          (draw-points (cdr points) "RIGHT" "000000" #f)
          (when pt (thread-sleep (- time pt)))
          (set! pt time)
        )
      )))
 )
)
end of example



Emilio Remolina
2000-10-04