Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
(defun max-licenses (&optional (logfile "mlijobs.txt"))
|
||||
(with-open-file (log logfile :direction :input)
|
||||
(do ((current-logs 0) (max-logs 0) (max-log-times '())
|
||||
(line #1=(read-line log nil nil) #1#))
|
||||
((null line)
|
||||
(format t "~&Maximum simultaneous license use is ~w at the ~
|
||||
following time~p: ~{~% ~a~}."
|
||||
max-logs (length max-log-times) (nreverse max-log-times)))
|
||||
(cl-ppcre:register-groups-bind (op time)
|
||||
("License (\\b.*\\b)[ ]{1,2}@ (\\b.*\\b)" line)
|
||||
(cond ((string= "OUT" op) (incf current-logs))
|
||||
((string= "IN" op) (decf current-logs))
|
||||
(t (cerror "Ignore it." "Malformed entry ~s." line)))
|
||||
(cond ((> current-logs max-logs)
|
||||
(setf max-logs current-logs
|
||||
max-log-times (list time)))
|
||||
((= current-logs max-logs)
|
||||
(push time max-log-times)))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue