com.bigdata.service
Class ServiceScore

java.lang.Object
  extended by com.bigdata.service.ServiceScore
All Implemented Interfaces:
Comparable<ServiceScore>

public class ServiceScore
extends Object
implements Comparable<ServiceScore>

Per-service metadata and a score for that service which gets updated periodically by the LoadBalancerService.UpdateTask. ServiceScores are a resource utilization measure. They are higher for a service which is more highly utilized. There are several ways to look at the score, including the rawScore, the rank, and the normalized double-precision rank. The ranks move in the same direction as the rawScores - a higher rank indicates higher utilization. The least utilized service is always rank zero (0). The most utilized service is always in the last rank.

Version:
$Id: ServiceScore.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
 double drank
          The normalized double precision rank in [0.0:1.0].
 String hostname
           
 int rank
          The rank in [0:#scored].
 double rawScore
          The raw score computed for that service.
 double score
          The normalized score computed for that service.
 String serviceName
           
 UUID serviceUUID
           
 
Constructor Summary
ServiceScore(String hostname, UUID serviceUUID, String serviceName)
          Constructor variant used when you do not have performance counters for the service and could not compute its rawScore.
ServiceScore(String hostname, UUID serviceUUID, String serviceName, double rawScore)
          Constructor variant used when you have computed the rawStore.
 
Method Summary
 int compareTo(ServiceScore arg0)
          Places elements into order by ascending rawScore.
static double normalize(double rawScore, double totalRawScore)
          Normalizes a raw score in the context of totals for some service.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hostname

public final String hostname

serviceUUID

public final UUID serviceUUID

serviceName

public final String serviceName

rawScore

public final double rawScore
The raw score computed for that service.


score

public double score
The normalized score computed for that service.


rank

public int rank
The rank in [0:#scored]. This is an index into the Scores[].


drank

public double drank
The normalized double precision rank in [0.0:1.0].

Constructor Detail

ServiceScore

public ServiceScore(String hostname,
                    UUID serviceUUID,
                    String serviceName)
Constructor variant used when you do not have performance counters for the service and could not compute its rawScore.

Parameters:
hostname -
serviceUUID -

ServiceScore

public ServiceScore(String hostname,
                    UUID serviceUUID,
                    String serviceName,
                    double rawScore)
Constructor variant used when you have computed the rawStore.

Parameters:
hostname -
serviceUUID -
rawScore -
Method Detail

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(ServiceScore arg0)
Places elements into order by ascending rawScore. The serviceUUID is used to break any ties.

Specified by:
compareTo in interface Comparable<ServiceScore>

normalize

public static double normalize(double rawScore,
                               double totalRawScore)
Normalizes a raw score in the context of totals for some service.

Parameters:
rawScore - The raw score.
totalRawScore - The raw score computed from the totals.
Returns:
The normalized score.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.