getTypeInfo(ObserveNativeImplConstants.PERCENTILE_VALUE).getType())); int percentileIndex = 0; for (PercentileValue percentileValue : snapshot.getPercentileValues()) { BMap<String, BValue> bPercentileValue = BLangVMStructs.createBStruct(percentileStructInfo, percentileValue.getPercentile(), snapshot.getTimeWindow().toMillis(), snapshot.getMean(), snapshot.getMax(), snapshot.getMin(), snapshot.getStdDev(), bPercentiles); bSnapshots.add(index, aSnapshot); index++;
public Snapshot getSnapshot() { rotate(); synchronized (this) { accumulateIfStale(); PercentileValue[] percentileValues = null; final double[] monitoredPercentiles = statisticConfig.getPercentiles(); if (monitoredPercentiles != null) { percentileValues = new PercentileValue[monitoredPercentiles.length]; for (int i = 0; i < monitoredPercentiles.length; i++) { final double p = monitoredPercentiles[i]; percentileValues[i] = new PercentileValue(p, accumulatedHistogram.getValueAtPercentile(p * 100)); } } return new Snapshot(statisticConfig.getTimeWindow(), accumulatedHistogram.getMinValue(), accumulatedHistogram.getMean(), accumulatedHistogram.getStdDeviation(), accumulatedHistogram.getMaxValue(), percentileValues); } }