Fork me on GitHub
#onyx
<
2016-12-07
>
Travis00:12:06

So just wondering if anyone has any useful Grafana ( riemann, influx ) queries that they have put together for onyx?

michaeldrogalis04:12:41

Code survival graph for Onyx core:

yonatanel14:12:48

Is there another hook to clean/mutate aggregation state other than apply-state-update and the two refinement options?

lucasbradstreet15:12:39

@yonatanel: no but I'm interested in hearing about any use cases that need anything else

nha16:12:17

How do you generate such a plot?

nha16:12:44

Thanks 🙂

michaeldrogalis16:12:29

Sure. 🙂

yonatanel17:12:28

@lucasbradstreet I do event sourcing, implemented with aggregation that accumulates the events together with the aggregate state, and then save the events to durable store in a sync function. Only then I can discard them from state. Currently, I can't discard them until the next call to aggregation/apply-state-update.

michaeldrogalis17:12:36

@yonatanel Discard only happens after sync finishes execution.

yonatanel17:12:08

I'm using accumulating refinement, not discarding. I need part of the state forever

michaeldrogalis17:12:54

Ah man. Raynes passed away ._.

yonatanel17:12:56

the aggregate is composed of events and the "reduce" of them. The reduce keeps living, the events can go to a store and be cleaned from the aggregate

michaeldrogalis17:12:44

@yonatanel If you can draw up a more concrete example, we can look at making a new refinement mode to support it, if that’s appropriate.

yonatanel18:12:52

@michaeldrogalis I put my cqrs example on github. Can you look at the aggregation and say if you understand the use case? https://github.com/yonatane/onyx-cqrs-example/blob/master/src/onyx_cqrs_example/account.cljs

michaeldrogalis18:12:07

Yep, will check it out shortly

michaeldrogalis19:12:41

@yonatanel Yeah, I think you need a custom refinement that respects the properties of your aggregate

yonatanel20:12:35

@michaeldrogalis I don't think it's documented but I see code in onyx/refinements.cljc and onyx/windowing/window_compile.clj that uses trigger refinement calls similar to aggregation calls.

michaeldrogalis20:12:16

@yonatanel Sorry? Do you have a question about it?

yonatanel20:12:46

Oh, yes. Is it usable? I didn't know you can write a custom refinement.

yonatanel20:12:40

Looks simple actually from the source

michaeldrogalis20:12:08

Yeah. The refinement interface is a public API

lucasbradstreet23:12:33

Do we not doc that in the cheat sheet? Probably not :/

lucasbradstreet23:12:40

Will get on that if not