org.gcube.datatransformation.datatransformationlibrary.statistics
Class StatisticsManager

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

public class StatisticsManager
extends Object

Author:
Dimitris Katris, NKUA StatisticsManager is responsible to maintain statistics for each operation performed by the Data Transformation Service.

Nested Class Summary
static class StatisticsManager.MetricType
           
 
Constructor Summary
StatisticsManager()
           
 
Method Summary
static Metric createMetric(String name, String description, StatisticsManager.MetricType mType)
          Creates a new Metric.
static Metric createMetric(String name, String description, StatisticsManager.MetricType mType, int maxNumMeasures)
          Creates a new Metric with a specific maximum number of measures.
static HashMap<String,Metric> getAllMetricsOfType(StatisticsManager.MetricType mType)
          Returns all metrics of one StatisticsManager.MetricType.
static Metric getMetric(String name, StatisticsManager.MetricType mType)
          Returns the Metric by its name and MetricType.
static String toXML()
          Converts the statistics to a an XML format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsManager

public StatisticsManager()
Method Detail

getMetric

public static Metric getMetric(String name,
                               StatisticsManager.MetricType mType)
Returns the Metric by its name and MetricType.

Parameters:
name - The name of the Metric.
mType - The type of the Metric.
Returns:
The Metric.

createMetric

public static Metric createMetric(String name,
                                  String description,
                                  StatisticsManager.MetricType mType)

Creates a new Metric.

Synchronization is applicable only for the iterators which are read in toXML().

Parameters:
name - The name of the new Metric.
description - A description of the new Metric.
mType - The type of the new Metric.
Returns:
The new Metric.

createMetric

public static Metric createMetric(String name,
                                  String description,
                                  StatisticsManager.MetricType mType,
                                  int maxNumMeasures)

Creates a new Metric with a specific maximum number of measures.

Synchronization is applicable only for the iterators which are read in toXML().

Parameters:
name - The name of the new Metric.
description - A description of the new Metric.
mType - The type of the new Metric.
maxNumMeasures - The maximum number of measures that will be taken for this Metric.
Returns:
The new Metric.

getAllMetricsOfType

public static HashMap<String,Metric> getAllMetricsOfType(StatisticsManager.MetricType mType)

Returns all metrics of one StatisticsManager.MetricType.

Accesses to the returned HashMap shall be synchronized on lock of the StatisticsManager instance.

Parameters:
mType - The type of the metrics.
Returns:
The metrics.

toXML

public static String toXML()
Converts the statistics to a an XML format.

Returns:
The XML representation of the statistics.


Copyright © 2013. All Rights Reserved.