Fork me on GitHub
#onyx
<
2016-11-30
>
chrisblom11:11:46

How can i log the output segments of a task?

chrisblom11:11:42

I'm trying to debug a hanging job, and want to inspect the output of a task

chrisblom11:11:51

(defn log-batch-after [event lifecycle]
  (let [task-map (:onyx.core/task-map event)
        task-name (:onyx/name task-map)]
    (log/info
             "After batch:" task-name
             "Output size:" (count (:onyx.core/results event))))
  {})

chrisblom11:11:35

I'm using this function in a lifecycle for all tasks, containing :lifecycle/after-read-batch log-after-read-batch

chrisblom11:11:55

but the output size is always 4

lucasbradstreet11:11:05

@chrisblom (count (:segments (:onyx.core/results event)))

lucasbradstreet11:11:45

results record includes four keys, :tree, :segments, :acks, and :retries