Skip to content

Instantly share code, notes, and snippets.

@chillitom
Last active December 21, 2015 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chillitom/6240567 to your computer and use it in GitHub Desktop.
Save chillitom/6240567 to your computer and use it in GitHub Desktop.
trying to wrap combine and adjust and getting exceptions
(defn combine-with-suffix
"same as riemann.streams/combine but takes a suffix argument to append to the service name"
[f suffix & children]
(combine f (adjust [:service str suffix] children)))
;java.lang.ClassCastException: clojure.lang.ArraySeq cannot be cast to clojure.lang.IFn
; at riemann.streams$combine$stream__8140$fn__8150.invoke(streams.clj:132)
; at riemann.streams$combine$stream__8140.invoke(streams.clj:132)
; at riemann.streams$moving_event_window$stream__8293$fn__8305.invoke(streams.clj:242)
; at riemann.streams$moving_event_window$stream__8293.invoke(streams.clj:242)
; ...
;using as follows:
(moving-event-window 5
(combine-with-suffix std-dev " std dev" prn)
; fixed -- needed to use apply to pass children var args into adjust function
(defn combine-with-suffix
"same as riemann.streams/combine but takes a suffix argument to append to the service name"
[f suffix & children]
(combine f (apply adjust [:service str suffix] children)))
@chillitom
Copy link
Author

fixed, see comment in code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment