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