Re: [abacus] Separate time-based from discrete usage metrics
Jean-Sebastien Delfino
Hi,
To fix the issue we decided to:metrics (the rest basically) 2. Store the time-based metrics in a separate DB(s)Your proposal looks good to me. Piotr, Kevin and Raj and I had several design discussions on this topic in the last few days and we've come up with a few more ideas on top of what you're describing here: - The distinction between time-based and discrete resource usage metering could also be understood as usage metering of a stateful vs stateless resource or metric. In the stateful case, we simply store the state of the resource instance in a separate DB like you're proposing (e.g. we store the fact that an app or a container is currently running, or has stopped), and update that state in place when it changes. Then to compute and report usage later on we just need to the current resource instance state from that DB. - We could continue to store the metrics in the current historical databases as well (on top of that new DB) to preserve the resource instance history as many users typically want to know their past usage. - Some of us were not sure if the time-based / discrete distinction should be at the resource type level or at the metric level... IMO your proposal to do that at the metric level is cleaner so I'm happy with it :) - The dataflow module will probably need a few minor code changes to detect the case where some of the output docs need to go to a separate DB (IIRC you or someone else also mentioned that on one of our scrums or on slack...) - Like you said, we may still need to maintain 2 DBs to purge old entries. If that's easier, we could also adjust the usage accumulator service and the dataflow module a bit to delete entries for inactive resource instances right away (e.g. when an app or container stops.) Thoughts? P.S. I'll add these comments to issue #88 as well to make it be easier to follow up there. - Jean-Sebastien On Thu, May 12, 2016 at 5:54 AM, Hristo Iliev <hsiliev(a)gmail.com> wrote: Hi, |
|