minimart-benchmark-2017/external-latency.rkt

34 lines
865 B
Racket
Raw Normal View History

2014-05-04 19:55:11 +00:00
#lang racket/base
(require racket/match)
(require racket/system)
(require logbook)
(define L (default-logbook))
(define E (standard-logbook-entry L "minimart" "external-latency"))
(define entry-name (logbook-entry-name E))
2014-05-04 19:55:11 +00:00
(define (start-bg command)
(match-define (list #f #f pid #f control)
(process/ports (current-output-port)
(current-input-port)
(current-error-port)
command))
control)
(log-info "Starting server...")
(define server-control
(start-bg (format "racket echo-server.rkt --logbook-entry-name ~a" entry-name)))
(sleep 5)
(log-info "Starting client...")
(define client-control
(start-bg (format "racket echo-client.rkt --logbook-entry-name ~a" entry-name)))
(log-info "Waiting for client termination...")
(client-control 'wait)
(log-info "Waiting for server termination...")
(server-control 'wait)
(log-info "Done.")