HistoricalMetrics { @JsonIgnore HostMetricsDto.HostType getHostType() { HostMetricsDto.HostType result = HostMetricsDto.HostType.UNKNOWN; if ( metrics != null && !metrics.isEmpty() && ( metrics.get( 0 ).getSeries() != null ) && !( metrics.get( 0 ) .getSeries() .isEmpty() ) ) { String name = metrics.get( 0 ).getSeries().get( 0 ).getName(); if ( name != null ) { if ( name.startsWith( "host_" ) ) { result = HostMetricsDto.HostType.RESOURCE_HOST; } else { if ( name.startsWith( "lxc_" ) ) { result = HostMetricsDto.HostType.CONTAINER_HOST; } } } } 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 testGetHostType() { assertEquals( HostMetricsDto.HostType.CONTAINER_HOST, chMetrics.getHostType() ); assertEquals( HostMetricsDto.HostType.RESOURCE_HOST, rhMetrics.getHostType() ); }