com.bigdata.service
Class HostScore

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

public class HostScore
extends Object
implements Comparable<HostScore>

Per-host metadata and a score for that host which gets updated periodically by LoadBalancerService.UpdateTask. HostScores are a resource utilization measure. They are higher for a host 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 host is always rank zero (0). The most utilized host is always in the last rank.

Version:
$Id: HostScore.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.
 
Constructor Summary
HostScore(String hostname)
          Constructor variant used when you do not have performance counters for the host and could not compute its rawScore.
HostScore(String hostname, double rawScore)
          Constructor variant used when you have computed the rawStore.
 
Method Summary
 int compareTo(HostScore arg0)
          Places elements into order by ascending rawScore (aka increasing utilization).
static double normalize(double rawScore, double totalRawScore)
          Normalizes a raw score in the context of totals for some host.
 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

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

HostScore

public HostScore(String hostname)
Constructor variant used when you do not have performance counters for the host and could not compute its rawScore.

Parameters:
hostname -

HostScore

public HostScore(String hostname,
                 double rawScore)
Constructor variant used when you have computed the rawStore.

Parameters:
hostname -
rawScore -
Method Detail

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(HostScore arg0)
Places elements into order by ascending rawScore (aka increasing utilization). The hostname is used to break any ties.

Specified by:
compareTo in interface Comparable<HostScore>

normalize

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

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


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