HistoricalMetrics { @JsonIgnore List<Series> getSeriesByType( final SeriesBatch.SeriesType type ) { if ( type == null ) { throw new IllegalArgumentException( "Series type could not be null." ); } List<Series> result = new ArrayList<>(); final HostMetricsDto.HostType hostType = getHostType(); if ( metrics != null ) { for ( SeriesBatch batch : metrics ) { result.addAll( batch.getSeriesByName( type.getName( hostType ) ) ); } } return result; } HistoricalMetrics();  HistoricalMetrics( @JsonProperty( "startTime" ) final Date startTime,
                              @JsonProperty( "endTime" ) final Date endTime,
                              @JsonProperty( "Metrics" ) final List<SeriesBatch> metrics );  HistoricalMetrics( final Date startTime, final Date endTime ); Date getStartTime(); void setStartTime( final Date startTime ); Date getEndTime(); void setEndTime( final Date endTime ); @JsonIgnore List<SeriesBatch> getMetrics(); Map<SeriesBatch.SeriesType, List<Series>> getSeriesMap(); double getContainerDiskUsed(); @JsonIgnore HostMetricsDto getHostMetrics(); static boolean isZeroMetric( HostMetricsDto hostMetricsDto );  }
@Test public void testGetSeriesByType() { assertEquals( 5, rhMetrics.getSeriesByType( SeriesBatch.SeriesType.CPU ).size() ); assertEquals( 2, chMetrics.getSeriesByType( SeriesBatch.SeriesType.CPU ).size() ); assertEquals( 4, rhMetrics.getSeriesByType( SeriesBatch.SeriesType.MEMORY ).size() ); assertEquals( 2, chMetrics.getSeriesByType( SeriesBatch.SeriesType.CPU ).size() ); assertEquals( 15, rhMetrics.getSeriesByType( SeriesBatch.SeriesType.DISK ).size() ); }