Random Bits of Open Code

Check-in [d057b9bff9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added gen-peak-for-user to commmand processing
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d057b9bff92a3749ddcde85cf2b5bd59826c979e
User & Date: jmoon18 2019-04-24 22:07:24
Context
2019-04-24
22:09
Added functions for generating peak usage check-in: b2f7e01263 user: jmoon18 tags: trunk
22:07
Added gen-peak-for-user to commmand processing check-in: d057b9bff9 user: jmoon18 tags: trunk
2019-04-23
23:33
Added code to remove the 50 oldest records which are over a month from last update check-in: d02d27340c user: jmoon18 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ringchart/runstats.scm.

73
74
75
76
77
78
79

80
81
82






83
84
85
86
87
88
89

90
91
92
93
94
95
      (install-history-file (get-environment-variable "HOME") ".runstats_history") ;;  [homedir] [filename] [nlines])
      (current-input-port (make-readline-port "runstats> "))
      (repl))
     (else (print "Command " cmd " not recognised"))))
  ((cmd param)
   (let* ((db       (open-db "people.db"))
	  (id       (let ((rec (get-person-by-uid db param)))

		      (if rec
			  (car rec)
			  -1))))






     (case (string->symbol cmd)
       ((all)
	(doit "people.db" id)
	(regen-rollup id)
        (print "ID: " id)
	(create-datafiles #f id)
	(close-database db))

       ((rollup)(regen-rollup id))
       ((datafiles)(create-datafiles #f id)) 
       ((update)(doit "people.db" id))
       (else (print "Command " cmd " with param " param " not recognised")))
     )))
   







>


|
>
>
>
>
>
>







>






73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
      (install-history-file (get-environment-variable "HOME") ".runstats_history") ;;  [homedir] [filename] [nlines])
      (current-input-port (make-readline-port "runstats> "))
      (repl))
     (else (print "Command " cmd " not recognised"))))
  ((cmd param)
   (let* ((db       (open-db "people.db"))
	  (id       (let ((rec (get-person-by-uid db param)))
                      (print rec)
		      (if rec
			  (car rec)
			  -1)))
	  (uid       (let ((rec (get-person-by-uid db param)))
                      (print rec)
		      (if rec
			  (cadr rec)
			  -1)))
         )
     (case (string->symbol cmd)
       ((all)
	(doit "people.db" id)
	(regen-rollup id)
        (print "ID: " id)
	(create-datafiles #f id)
	(close-database db))
       ((peak) (gen-peak-for-user param))
       ((rollup)(regen-rollup id))
       ((datafiles)(create-datafiles #f id)) 
       ((update)(doit "people.db" id))
       (else (print "Command " cmd " with param " param " not recognised")))
     )))