[Hawkular-dev] [Metrics] Pluggable aggregation functions: next steps

Thomas Segismont tsegismo at redhat.com
Tue Jul 21 05:43:54 EDT 2015


Hi,

I have looked at Aakarsh's repo:
https://github.com/Akki5/hawkular_plugin/

It's a good start with an interface describing a doubles to double 
function, a classloader for implementation loading and a set of initial 
implementations.

In order to integrate this work into Metrics, I think we should follow 
the following steps:

=====
#1 Change the contract

Doubles to double works great for avg/min/max/... functions on gauge 
metrics. But we need to consider other metric types.

Also, the interface should not only accept data point values, but whole 
data points. Because some functions need the timestamp to compute the 
result. % of up availability is a good example.

And functions may return different types: Double, Long, AvailabilityType.

#2 Update configuration options to let the user set a plugins directory

Metrics doc needs will have to be updated.

#3 Create a function repository for each metric type

We can build on JDK's service loader + Aakarsh's classloader implementation.

#4 Add builtin aggregate functions

Extract existing Metrics code (min, max, avg, % of up avail, downtime 
duration) into builtin functions.

#5 Document the process of implementing a pluggable function

We need to think about function naming as well. Should we use a prefix 
to identify a builtin function?
=====

I will start another thread to discuss REST and Core API data query changes.

Thoughts?

Thanks,
Thomas


More information about the hawkular-dev mailing list