public GridCoverageReaderMetrics( IRenderContext context2, GridCoverageReaderMetricsFactory factory) {
super( context2, factory, listExpectedStyleIds());
this.resolutionMetric = RES_PIXEL; // reads just what is needed for the screen
// DATA SOURCE PERFORMANCE INDICATORS
ID id = context.getGeoResource().getID();
// Boolean memory = (Boolean) context.getLayer().getStyleBlackboard().get("org.locationtech.udig.style.cache");
if( id.isMemory() ){
// in memory grid coverage (example a temporary image froma WPS)
this.latencyMetric = LATENCY_MEMORY;
this.timeToDrawMetric = DRAW_IMAGE_MEMORY;
}
else if (id.isFile() ){
String filename = id.toBaseFile();
if( filename.toLowerCase().endsWith("jpg") ||
filename.toLowerCase().endsWith("jpeg")){
this.latencyMetric = LATENCY_LOCAL;
this.timeToDrawMetric = DRAW_IMAGE_COMPRESSED;
}