public void addSnapshot( LogChannelInterface logChannel, MetricsSnapshotInterface snapshot ) { MetricsInterface metric = snapshot.getMetric(); String channelId = logChannel.getLogChannelId(); switch ( metric.getType() ) { case START: case STOP: Queue<MetricsSnapshotInterface> list = getSnapshotList( channelId ); list.add( snapshot ); break; case MIN: case MAX: case SUM: case COUNT: Map<String, MetricsSnapshotInterface> map = getSnapshotMap( channelId ); map.put( snapshot.getKey(), snapshot ); break; default: break; } }
Map<String, MetricsDuration> map = new HashMap<String, MetricsDuration>(); Queue<MetricsSnapshotInterface> metrics = MetricsRegistry.getInstance().getSnapshotList( logChannelId );
List<MetricsDuration> durations = new ArrayList<MetricsDuration>(); Queue<MetricsSnapshotInterface> metrics = MetricsRegistry.getInstance().getSnapshotList( logChannelId ); MetricsSnapshotInterface start = null;
metricsList = metricsRegistry.getSnapshotList( logChannelId ); snapshot = new MetricsSnapshot( MetricsSnapshotType.START, metric, subject, 1L, logChannelId ); metricsList.add( snapshot ); metricsList = metricsRegistry.getSnapshotList( logChannelId ); snapshot = new MetricsSnapshot( MetricsSnapshotType.STOP, metric, subject, 1L, logChannelId ); metricsList.add( snapshot );