Resource's DSL "metric" actions

Hi @Zach Daniel, related to yesterday's question (https://discord.com/channels/711271361523351632/1097912088296443904) I got a new hint: we're trying a full-spread ash adoption on our internal project and we're trying to use only resource's code-interfaces everywhere, but for yesterday count/1 I've to call api module directly. What about the idea of a new kind of action supported by ash resource's DSL for defining resource's metrics methods in a declarative way? For example on a User resource we can declare a simple metric :daily_subscribers action applying some logic and filters that returns a count of that metric. Going forward we could think about a more widely metric :subscribers_growth action accepting a period argument that let us select a specific time window for that metric. All this actions could then be declared within the resources's code_interface. I think this new kind of actions could be an useful feature on all ash extension (graphql, json, ...) 🙂
1 Reply
ZachDaniel
ZachDaniel•3y ago
We will be adding “raw” or “functional” actions to resources soon, which will allow you to construct exactly these kinds of things 🙂

Did you find this page helpful?