Class DefaultStatisticsChart
- java.lang.Object
-
- de.hybris.platform.servicelayer.stats.chart_impl.DefaultStatisticsChart
-
- All Implemented Interfaces:
StatisticsChart
- Direct Known Subclasses:
DBConnectionsInUseStatsticsChart,SessionsStatisticsChart
public class DefaultStatisticsChart extends java.lang.Object implements StatisticsChart
-
-
Constructor Summary
Constructors Constructor Description DefaultStatisticsChart(java.lang.String name, java.lang.String unit)DefaultStatisticsChart(java.lang.String name, java.lang.String unit, StatisticsService statisticsService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAggregatedCollector(AggregatedStatisticsCollector collector)Add an aggregated collector to the chart.booleanaddLine(StatisticsCollector collector)Add aAbstractStatisticsCollectorto this chart.booleanaddLinetoView(java.lang.String name, StatisticsCollector collector)Add an specificStatisticsCollectorto the view identified by name.booleanaddView(java.lang.String name, java.util.List<StatisticsCollector> collectors)Add a view called name with theStatisticsCollectors to this chart.booleancontainsLine(java.lang.String name)Checks if the chart contains aStatisticsCollectorcalled name.AggregatedStatisticsCollectorgetAggregatedCollector(java.lang.String aggregatedName)Get all collectors that do not collect data itself but just aggregate data collected by other collectors.java.util.List<AggregatedStatisticsCollector>getAggregatedLines()Get only lines of typeAggregatedStatisticsCollector.java.util.List<AggregatedStatisticsCollector>getAllAggregatedCollectors()Get all aggregated collectors contained in this chart.java.util.List<StatisticsCollector>getAllLines()Get AllStatisticsCollectors from this chart.java.util.List<BasicStatisticsCollector>getBasicLines()Get only lines of typeBasicStatisticsCollector.StatisticsCollectorgetLine(java.lang.String name)Get a specific line from this chart, identified by name.intgetLineCount()Get the number of registeredStatisticsCollectors.java.lang.StringgetName()Get the name of thisStatisticsChart.java.lang.StringgetUnit()java.util.List<StatisticsCollector>getViewLines(java.lang.String view)Get all lines contained in view.booleanremoveLine(StatisticsCollector collector)RemovesAbstractStatisticsCollectoridentified by name from this chart.voidsetAggregatedLines(java.util.List<AggregatedStatisticsCollector> lines)voidsetBasicLines(java.util.List<BasicStatisticsCollector> lines)voidsetViews(java.util.Map<java.lang.String,java.util.List<StatisticsCollector>> mapping)
-
-
-
Constructor Detail
-
DefaultStatisticsChart
public DefaultStatisticsChart(java.lang.String name, java.lang.String unit)
-
DefaultStatisticsChart
public DefaultStatisticsChart(java.lang.String name, java.lang.String unit, StatisticsService statisticsService)
-
-
Method Detail
-
addLine
public boolean addLine(StatisticsCollector collector)
Description copied from interface:StatisticsChartAdd aAbstractStatisticsCollectorto this chart.- Specified by:
addLinein interfaceStatisticsChart- Returns:
- Indicating if adding the
AbstractStatisticsCollectorwas successful.
-
removeLine
public boolean removeLine(StatisticsCollector collector)
Description copied from interface:StatisticsChartRemovesAbstractStatisticsCollectoridentified by name from this chart.- Specified by:
removeLinein interfaceStatisticsChart- Parameters:
collector- The collector to remove.
-
getLine
public StatisticsCollector getLine(java.lang.String name)
Description copied from interface:StatisticsChartGet a specific line from this chart, identified by name.- Specified by:
getLinein interfaceStatisticsChart- Parameters:
name- The name of theStatisticsCollectoryou want to get.- Returns:
- The
StatisticsCollectorwith Name name.
-
getAllLines
public java.util.List<StatisticsCollector> getAllLines()
Description copied from interface:StatisticsChartGet AllStatisticsCollectors from this chart.- Specified by:
getAllLinesin interfaceStatisticsChart- Returns:
- The Sorted Map
StatisticsCollector> containing all StatisticsCollectors.
-
getLineCount
public int getLineCount()
Description copied from interface:StatisticsChartGet the number of registeredStatisticsCollectors.- Specified by:
getLineCountin interfaceStatisticsChart- Returns:
- The number of collectors in this chart.
-
getName
public java.lang.String getName()
Description copied from interface:StatisticsChartGet the name of thisStatisticsChart.- Specified by:
getNamein interfaceStatisticsChart- Returns:
- The name of this
StatisticsChart.
-
getUnit
public java.lang.String getUnit()
-
addView
public boolean addView(java.lang.String name, java.util.List<StatisticsCollector> collectors)Description copied from interface:StatisticsChartAdd a view called name with theStatisticsCollectors to this chart.- Specified by:
addViewin interfaceStatisticsChart- Parameters:
name- The name of the view to add.collectors- The collectors to add to the view.- Returns:
- Indicating if adding was successful.
-
addLinetoView
public boolean addLinetoView(java.lang.String name, StatisticsCollector collector)Description copied from interface:StatisticsChartAdd an specificStatisticsCollectorto the view identified by name.- Specified by:
addLinetoViewin interfaceStatisticsChart- Returns:
- Indicating if adding was successful.
-
getViewLines
public java.util.List<StatisticsCollector> getViewLines(java.lang.String view)
Description copied from interface:StatisticsChartGet all lines contained in view. If specified view does not exist, all lines contained in this chart are returned.- Specified by:
getViewLinesin interfaceStatisticsChart- Parameters:
view- The name of the view that you want to get theStatisticsCollectors from.
-
setBasicLines
public void setBasicLines(java.util.List<BasicStatisticsCollector> lines)
-
setAggregatedLines
public void setAggregatedLines(java.util.List<AggregatedStatisticsCollector> lines)
-
containsLine
public boolean containsLine(java.lang.String name)
Description copied from interface:StatisticsChartChecks if the chart contains aStatisticsCollectorcalled name.- Specified by:
containsLinein interfaceStatisticsChart- Returns:
- True, if collector is contained, false if not.
-
setViews
public void setViews(java.util.Map<java.lang.String,java.util.List<StatisticsCollector>> mapping)
-
getAggregatedCollector
public AggregatedStatisticsCollector getAggregatedCollector(java.lang.String aggregatedName)
Description copied from interface:StatisticsChartGet all collectors that do not collect data itself but just aggregate data collected by other collectors.- Specified by:
getAggregatedCollectorin interfaceStatisticsChart- Returns:
- The name of the collectors that values should be aggregated.
-
addAggregatedCollector
public boolean addAggregatedCollector(AggregatedStatisticsCollector collector)
Description copied from interface:StatisticsChartAdd an aggregated collector to the chart.- Specified by:
addAggregatedCollectorin interfaceStatisticsChart- Parameters:
collector- TheAggregatedStatisticsCollectorto add to the chart.- Returns:
- Indicating if adding was successful or not.
-
getAllAggregatedCollectors
public java.util.List<AggregatedStatisticsCollector> getAllAggregatedCollectors()
Description copied from interface:StatisticsChartGet all aggregated collectors contained in this chart.- Specified by:
getAllAggregatedCollectorsin interfaceStatisticsChart- Returns:
- All aggregated collectors in a map, where the key is the name of the aggregated collector and the value is
a list containing all
StatisticsCollectors.
-
getBasicLines
public java.util.List<BasicStatisticsCollector> getBasicLines()
Description copied from interface:StatisticsChartGet only lines of typeBasicStatisticsCollector.- Specified by:
getBasicLinesin interfaceStatisticsChart- Returns:
- The contained collectors of type BasicStatisticsCollector.
-
getAggregatedLines
public java.util.List<AggregatedStatisticsCollector> getAggregatedLines()
Description copied from interface:StatisticsChartGet only lines of typeAggregatedStatisticsCollector.- Specified by:
getAggregatedLinesin interfaceStatisticsChart- Returns:
- The contained collectors of type AggregatedStatisticsCollector.
-
-