[Abacus] Tagging usage

KRuelY <kevinyudhiswara@...>


I'm looking for a way to classify usage. My use case is this:

I have 2 type of usage:
1. Usage of type A.
2. Usage of type B.

The initial thought to do this with the current abacus is to create 2
separate plan(say plan a & plan b). This way, usage of type A would go under
'plan a' and usage of type B would go under 'plan b'.

Due to past design, I am unable to do so and hence I need to separate usage
under the same plan into 2 type: type A and type B.

A more detailed use case would be when pricing change in the middle of the
month. Here, I need to separate my usage into usage of type A that would use
the old pricing, and usage of type B that would use the new pricing.

The main reason of splitting them up is that I would like to have two
different bucket for the two usage because keeping the two usage in the same
bucket is not going to work(will give inaccurate result) due to:

Use cases:
1. Price changed on the 15th. Get quantity usage from beginning of the
month(A), and get quantity usage at the end of the month(B). The price would
be: A * old price + (B - A) * new price. This would work if the accumulation
formula is plain sum, but if the formula is max / average this would not

2. Query beginning of the month to middle of the month and query middle of
the month to end of the month. querying from x to y is not supported, and
with the accumulating and retracting dataflow model that we have this is not

3. One way that would work is to utilize the flexibility of the meter,
accumulate, and aggregate functions in the resource config to separate usage
of type A and type B. I don't think this is a good design, but the point is
that we can utilize the flexibility of the functions in the resource config
to maybe generate a new idea.

Would tagging a usage be a good idea? For example Under plan we would have

bucket A:
bucket B:

my concern with this is we would have to add another (key, value) pair to
create another landmark window, and also the usage submitted would need
another field that will serve as the 'tag'.

Any thought or idea to implement this? Other than to create 2 separate plans
and tagging, the ideas mentioned above are not really viable.


View this message in context: http://cf-dev.70369.x6.nabble.com/Abacus-Tagging-usage-tp3089.html
Sent from the CF Dev mailing list archive at Nabble.com.

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.