Megatest

Check-in [cd7bf0e858]
Login
Overview
Comment:Added dep for whodunit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.65
Files: files | file ages | folders
SHA1: cd7bf0e85808bd176d134fe0f999dccb3e1cebf2
User & Date: mrwellan on 2020-11-24 21:21:53
Other Links: branch diff | manifest | tags
Context
2020-11-25
12:57
Merged fix for server gating check-in: a1ae1509c1 user: mrwellan tags: v1.65, v1.6578
2020-11-24
21:21
Added dep for whodunit. check-in: cd7bf0e858 user: mrwellan tags: v1.65
2020-11-20
13:10
Converted whodunit to chicken 5 check-in: 28b4ff78b6 user: jmoon18 tags: v1.65
Changes

Modified utils/Makefile.whodunit from [e57c664f04] to [2690881b41].

1
2
3
4
5
6
7
8
9
.DEFAULT : all

all : whodunit

clean : 
	rm whodunit

whodunit : 
	csc -static -L -static -L -lm -L -ldl -L -lpthread -L -lssl -L -lcrypto -L -lz whodunit.scm -o whodunit 







|

1
2
3
4
5
6
7
8
9
.DEFAULT : all

all : whodunit

clean : 
	rm whodunit

whodunit : whodunit.scm
	csc -static -L -static -L -lm -L -ldl -L -lpthread -L -lssl -L -lcrypto -L -lz whodunit.scm -o whodunit 

Modified utils/whodunit.scm from [f5e767ace5] to [4709c0e629].

20
21
22
23
24
25
26

27
28
29
30
31
32
33
 *


(import 
  (chicken process-context)
  (chicken process)
  (chicken string)

  (chicken sort)
  (chicken io)
  srfi-69
  scheme
)

(define *numsamples* (or (and (> (length (argv)) 1)







>







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 *


(import 
  (chicken process-context)
  (chicken process)
  (chicken string)
  (chicken base)
  (chicken sort)
  (chicken io)
  srfi-69
  scheme
)

(define *numsamples* (or (and (> (length (argv)) 1)
59
60
61
62
63
64
65











66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
   (lambda (indat)
     (let ((pid (car indat))
           (usr (cadr indat))
           (cpu (list-ref indat 8)))
       (hash-table-set! ht usr (+ cpu (hash-table-ref/default ht usr 0)))))
   data))












)
(import whodunit srfi-69 (chicken sort))

(print "Getting " *numsamples* " samples of cpu usage data.")
(define data (cleanup-data (topdata)))
(define pidhash  (make-hash-table))
(define userhash (make-hash-table))
(sum-up data userhash)


(for-each
 (lambda (usr)
   (let* ((usage (inexact->exact (round (/ (hash-table-ref userhash usr) *numsamples*)))))
     (if (> usage 0)
	 (print usr (if (< (string-length usr) 8) "\t\t" "\t") usage))))
 (sort (hash-table-keys userhash)
       (lambda (a b)
         (> (hash-table-ref userhash a)
	    (hash-table-ref userhash b)))))








>
>
>
>
>
>
>
>
>
>
>









<
<
<
<
<
<
|
<
<
<
<
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86






87




   (lambda (indat)
     (let ((pid (car indat))
           (usr (cadr indat))
           (cpu (list-ref indat 8)))
       (hash-table-set! ht usr (+ cpu (hash-table-ref/default ht usr 0)))))
   data))

(define (print-results userhash)
  (for-each
   (lambda (usr)
     (let* ((usage (inexact->exact (round (/ (hash-table-ref userhash usr) *numsamples*)))))
       (if (> usage 0)
	   (print usr (if (< (string-length usr) 8) "\t\t" "\t") usage))))
   (sort (hash-table-keys userhash)
	 (lambda (a b)
           (> (hash-table-ref userhash a)
	      (hash-table-ref userhash b))))))
  
)
(import whodunit srfi-69 (chicken sort))

(print "Getting " *numsamples* " samples of cpu usage data.")
(define data (cleanup-data (topdata)))
(define pidhash  (make-hash-table))
(define userhash (make-hash-table))
(sum-up data userhash)







(print-results userhash)