From 203034bcd8a530cf0a8433b49e1bda7377600da6 Mon Sep 17 00:00:00 2001 From: Austin Blatt Date: Tue, 26 Sep 2023 10:36:35 -0700 Subject: [PATCH] (PDB-5691) benchmark: update async diagram --- src/puppetlabs/puppetdb/cli/benchmark.clj | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/puppetlabs/puppetdb/cli/benchmark.clj b/src/puppetlabs/puppetdb/cli/benchmark.clj index 10cc8b0383..e65a7deca0 100644 --- a/src/puppetlabs/puppetdb/cli/benchmark.clj +++ b/src/puppetlabs/puppetdb/cli/benchmark.clj @@ -512,7 +512,8 @@ (defn register-shutdown-hook! [f] (.addShutdownHook (Runtime/getRuntime) (Thread. f))) -;; The core.async processes and channels fit together like this: +;; The core.async processes and channels fit together like +;; this (square brackets indicate data being sent): ;; ;; (initial-hosts-ch: host-maps) ;; | @@ -526,15 +527,24 @@ ;; mult (simulation-write-ch: host-maps) ------------------------/ ;; | ;; | (command-send-ch: host-maps) +;; | +;; [host-state] +;; | ;; v ;; command-sender ;; | +;; [factset, delayed catalog, delayed report] +;; | +;; v +;; (scheduler) +;; | ;; | (rate-monitor-ch: ::success or ::error) ;; v ;; rate-monitor ;; ;; It's all set up so that channel closes flow downstream (and upstream to the -;; producer). Closing simulation-read-ch shuts down everything. +;; producer). The command-sender is not a pipeline so to shut down benchmark +;; simulation-read-ch and fanout-ch must be closed and the scheduler shutdown. (defn benchmark "Feeds commands to PDB as requested by args. Returns a map of :join, a