Megatest

Changes On Branch 919bc699d8701393
Login

Changes In Branch v1.65-rmt-call-throttle Excluding Merge-Ins

This is equivalent to a diff from cd0bb84cf2 to 919bc699d8

2020-10-12
13:06
Added in the query-rest stuff. check-in: 0e1320be35 user: mrwellan tags: v1.65-side2
2020-10-04
14:41
568abab962 Leaf check-in: a4862b4d9f user: matt tags: v1.70-dashboard
14:01
Create new branch named "v1.70-fresh" Closed-Leaf check-in: f29f4050e0 user: matt tags: v1.70-fresh (unpublished)
02:13
effed Closed-Leaf check-in: 54d01a66a4 user: mrwellan tags: v1.65-defunct
00:48
From: 53cfda8951 check-in: ba457efadd user: mrwellan tags: v1.65-pre-70 (unpublished)
2020-10-02
16:03
If local check pstree locally ==/3.05/0.8/PASS/1202/mars/== check-in: 53cfda8951 user: matt tags: v1.70-defunct
2020-09-28
23:41
Moving call throttle attempt to v1.6564 ==5.71/0.8/WARN/1201== Leaf check-in: 919bc699d8 user: mrwellan tags: v1.65-rmt-call-throttle
22:48
Dashboard stutter fix. ==/4.7/0.8/PASS/1203/orion/== ==/6.3/0.9/WARN/1201/mars/== check-in: f525182460 user: mrwellan tags: v1.65-dashboard-stutter-fix
22:37
Cherrypicked genexample work f81a, 31ed, 3213, c9ef, 0c39, 0dbb, 658e ==/6.1/0.8/WARN/1201/mars/== Closed-Leaf check-in: ba70452f7f user: mrwellan tags: v1.65-genexample
10:23
Create new branch named "v1.6564-refactor" ==3.98/0.9/PASS/1203== check-in: ace09d605e user: mrwellan tags: v1.6564-refactor
2020-08-20
13:01
Phase 1 of extract skeleton is working. Need to generate testconfigs next. ==/5.2/0.7/WARN/1201/mars/== check-in: f81a147c94 user: mrwellan tags: v1.65
11:11
changed version to 1.6564 ==3.39/1.0/PASS/1203/orion== v1.70 START check-in: cd0bb84cf2 user: mmgraham tags: v1.65, v1.6564
2020-08-19
23:53
Can't use stmt caching where string compiled changes with every query. Fixed wrong presevation of last-update for clean printing of pass/fail etc. check-in: dde2e2b857 user: mrwellan tags: v1.65

Modified rmt.scm from [03bc9d9a92] to [5a80c1530e].

52
53
54
55
56
57
58



















59
60
61
62
63
64
65


66
67
68
69
70
71
72
73
	      cinfo
	      (if (server:check-if-running areapath)
		  (client:setup areapath)
		  #f))))

(define *send-receive-mutex* (make-mutex)) ;; should have separate mutex per run-id




















;; RA => e.g. usage (rmt:send-receive 'get-var #f (list varname))
;;
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected

  #;(common:telemetry-log (conc "rmt:"(->string cmd))
                        payload: `((rid . ,rid)
                                   (params . ,params)))


                          
  (if (> attemptnum 2)
      (debug:print 0 *default-log-port* "INFO: attemptnum in rmt:send-receive is " attemptnum))
    
  (cond
   ((> attemptnum 2) (thread-sleep! 0.05))
   ((> attemptnum 10) (thread-sleep! 0.5))
   ((> attemptnum 20) (thread-sleep! 1)))







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







>
>
|







52
53
54
55
56
57
58
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
86
87
88
89
90
91
92
93
94
	      cinfo
	      (if (server:check-if-running areapath)
		  (client:setup areapath)
		  #f))))

(define *send-receive-mutex* (make-mutex)) ;; should have separate mutex per run-id

(define *rmt-query-last-call-time* 0)
(define *rmt-query-last-rest-time* 0) ;; last time there was at least a 1/2 second rest - giving other processes access to the db

;; NOTE: This query rest algorythm will not adapt to long query times. REDESIGN NEEDED. TODO. FIXME.
;;
(define (rmt:query-rest)
  (let* ((now (current-milliseconds)))
    (cond
     ((> (- now *rmt-query-last-call-time*) 500)  ;; it's been a while since last query - no need to rest
      (set! *rmt-query-last-rest-time*  now)
      (set! *rmt-query-last-call-time*  now))
     ((> (- now *rmt-query-last-rest-time*) 5000) ;; no natural rests have happened
      (debug:print 0 *default-log-port* "query rest needed. blocking for 1/2 second.")
      (thread-sleep! 0.5) ;; force a rest of a half second
      (set! *rmt-query-last-rest-time* now)
      (set! *rmt-query-last-call-time* now))
     (else ;; sufficient rests have occurred, just record the last query time
      (set! *rmt-query-last-call-time* now)))))

;; RA => e.g. usage (rmt:send-receive 'get-var #f (list varname))
;;
(define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) ;; start attemptnum at 1 so the modulo below works as expected

  #;(common:telemetry-log (conc "rmt:"(->string cmd))
                        payload: `((rid . ,rid)
                                   (params . ,params)))
  (if (not (equal? (configf:lookup *configdat* "setup" "query-rest") "no"))
      (rmt:query-rest))
  
  (if (> attemptnum 2)
      (debug:print 0 *default-log-port* "INFO: attemptnum in rmt:send-receive is " attemptnum))
    
  (cond
   ((> attemptnum 2) (thread-sleep! 0.05))
   ((> attemptnum 10) (thread-sleep! 0.5))
   ((> attemptnum 20) (thread-sleep! 1)))