Add bang after set-... commands.
This commit is contained in:
parent
05b7af0986
commit
4183ec85ce
|
@ -20,9 +20,9 @@
|
|||
(define-record-type state :state
|
||||
(make-state file-name file-names-to-delete counter)
|
||||
state?
|
||||
(file-name state:file-name set-state:file-name)
|
||||
(file-names-to-delete state:file-names-to-delete set-state:file-names-to-delete)
|
||||
(counter state:counter set-state:counter))
|
||||
(file-name state:file-name set-state:file-name!)
|
||||
(file-names-to-delete state:file-names-to-delete set-state:file-names-to-delete!)
|
||||
(counter state:counter set-state:counter!))
|
||||
|
||||
(define (state-file-name)
|
||||
(state:file-name (get-servlet-data)))
|
||||
|
@ -112,7 +112,7 @@
|
|||
(profile-space (state:file-name state))
|
||||
(release-lock lock)
|
||||
(format #t "profile recorded in ~s~%" (state:file-name state))
|
||||
(set-state:counter state (+ 1 (state:counter state)))
|
||||
(set-state:counter! state (+ 1 (state:counter state)))
|
||||
(profile req (format #f "Profile #~a generated" (state:counter state)))))
|
||||
|
||||
(define (result req)
|
||||
|
@ -200,24 +200,25 @@ plot '~a' title 'Servlet Profiling ~a' with lines"
|
|||
|
||||
(define (add-file-name-to-delete! file-name)
|
||||
(let ((state (get-servlet-data)))
|
||||
(set-state:file-names-to-delete
|
||||
(set-state:file-names-to-delete!
|
||||
state
|
||||
(cons file-name
|
||||
(state:file-names-to-delete state)))))
|
||||
|
||||
(define (delete-files state)
|
||||
(format #t "running delete-files with state ~a~%" (state:file-names-to-delete state))
|
||||
(let ((file-names-to-delete (state:file-names-to-delete state)))
|
||||
(if file-names-to-delete
|
||||
(for-each delete-filesys-object file-names-to-delete))))
|
||||
|
||||
(define (reset-profiling-state!)
|
||||
(let ((state (get-servlet-data)))
|
||||
(set-state:counter state 0)
|
||||
(set-state:counter! state 0)
|
||||
(delete-files state)
|
||||
(set-state:file-name state
|
||||
(absolute-file-name (create-temp-file "servlet-profiling")))
|
||||
(set-state:file-names-to-delete state
|
||||
(list (state:file-name state)))))
|
||||
(set-state:file-name! state
|
||||
(absolute-file-name (create-temp-file "servlet-profiling")))
|
||||
(set-state:file-names-to-delete! state
|
||||
(list (state:file-name state)))))
|
||||
|
||||
(define (reset-and-return-to-main-page req)
|
||||
;; Overhead included :-|
|
||||
|
|
Loading…
Reference in New Issue