org.gcube.datatransformation.datatransformationlibrary.statistics
Class Metric

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.statistics.Metric

public class Metric
extends Object

Author:
Dimitris Katris, NKUA Metric class maintains measures for a specific operation performed by the DTS.

Constructor Summary
Metric(String name, String description)
          Instantiates a new Metric.
Metric(String name, String description, int maxNumMeasures)
          Instantiates a new Metric.
 
Method Summary
 void addMeasure(Long measuredVal)
          Adds a measure to this Metric.
 String getDescription()
          Returns the description of the Metric.
 long getMaxMeasure()
          Returns the maximum measured value for the metric
 long getMeanOfMeasures()
          Returns the mean value of all the measured values
static long getMeanValueOfMetrics(Collection<Metric> metrics)
          Returns the mean value of a Collection of Metrics.
 long getMinMeasure()
          Returns the minimum measured value for the metric
 String getName()
          Returns the name of the Metric..
 void reset()
          Resets the counting of the statistics of this Metric.
 void setDescription(String description)
          Sets the description of the Metric.
 void setName(String name)
          Sets the name of the Metric.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Metric

public Metric(String name,
              String description)
Instantiates a new Metric.

Parameters:
name - The name of the Metric.
description - The description of the Metric.

Metric

public Metric(String name,
              String description,
              int maxNumMeasures)
Instantiates a new Metric.

Parameters:
name - The name of the Metric.
description - The description of the Metric.
maxNumMeasures - The maximum number of measures that will be taken for this Metric.
Method Detail

getDescription

public String getDescription()
Returns the description of the Metric.

Returns:
The description of the Metric.

setDescription

public void setDescription(String description)
Sets the description of the Metric.

Parameters:
description - The description of the Metric.

getName

public String getName()
Returns the name of the Metric..

Returns:
The name of the Metric.

setName

public void setName(String name)
Sets the name of the Metric.

Parameters:
name - The name of the Metric.

addMeasure

public void addMeasure(Long measuredVal)
Adds a measure to this Metric.

Parameters:
measuredVal - The value of the measure.

getMinMeasure

public long getMinMeasure()
Returns the minimum measured value for the metric

Returns:
the min value

getMaxMeasure

public long getMaxMeasure()
Returns the maximum measured value for the metric

Returns:
the max value

getMeanOfMeasures

public long getMeanOfMeasures()
Returns the mean value of all the measured values

Returns:
the mean value

reset

public void reset()
Resets the counting of the statistics of this Metric.


getMeanValueOfMetrics

public static long getMeanValueOfMetrics(Collection<Metric> metrics)
Returns the mean value of a Collection of Metrics.

Parameters:
metrics - The Collection of Metrics.
Returns:
The mean value of these Metrics.


Copyright © 2013. All Rights Reserved.