akka/akka — pull request #858 by patriknw (2012-11-07 19:44:09+00:00)
Title: ClusterLoadBalancingRouter and refactoring of metrics, see #2547

Not ready for merge. Intended for discussion of the solution (and review).

The meat of the ticket is in the MetricsSelector and ClusterLoadBalancingRouter. The rest is refactoring/improvements of the MetricsCollector.

What do you think about the name? Should it be something with 'adaptive'. AdaptiveLoadBalancingRouter?

This is what is what has been done:
* ClusterLoadBalancingRouter, similar to other routers
* MetricsSelector, calculate capacity, weights and allocate weighted
routee refs
* ClusterLoadBalancingRouterSpec
* Optional heap max
* Constants for the metric fields
* Refactoring of Metric and decay
* Rewrite of DataStreamSpec
* Correction of EWMA and removal of BigInt, BigDecimal
* Separation of MetricsCollector into trait and two classes,
SigarMetricsCollector and JmxMetricsCollector
* This will reduce cost when sigar is not installed, such as
avoiding throwing and catching exc for every call
* Improved error handling for loading sigar
* Made MetricsCollector implementation configurable
* Tested with sigar

Remaining todo:
* More selectors and test of them
* Documentation
* Some FIXMEs