/** * {@inheritDoc} */ @Override public int getCacheHitRatio() { return (int) (cache.getStatistics().getExtended().cacheHitRatio().value().doubleValue() * ONE_HUNDRED); }
/** * {@inheritDoc} */ @Override public SampledCounter getCacheHitRatioSample() { return new SampledCounterProxy<Double>(cache.getStatistics().getExtended().cacheHitRatio()) { @Override public TimeStampedCounterValue getMostRecentSample() { return new TimeStampedCounterValue(System.currentTimeMillis(), getValue()); } @Override public TimeStampedCounterValue[] getAllSampleValues() { ArrayList<TimeStampedCounterValue> arr = new ArrayList<TimeStampedCounterValue>(); for (Timestamped<Double> ts : rate.history()) { arr.add(new TimeStampedCounterValue(ts.getTimestamp(), (int) (ts.getSample().doubleValue() * ONE_HUNDRED))); } return sortAndPresent(arr); } @Override public long getValue() { return (long) (rate.value().doubleValue() * ONE_HUNDRED); } }; }
/** * {@inheritDoc} */ @Override public int getCacheHitRatio() { return (int) (cache.getStatistics().getExtended().cacheHitRatio().value().doubleValue() * ONE_HUNDRED); }
/** * {@inheritDoc} */ @Override public int getCacheHitRatio() { return (int) (cache.getStatistics().getExtended().cacheHitRatio().value().doubleValue() * ONE_HUNDRED); }
/** * {@inheritDoc} */ @Override public SampledCounter getCacheHitRatioSample() { return new SampledCounterProxy<Double>(cache.getStatistics().getExtended().cacheHitRatio()) { @Override public TimeStampedCounterValue getMostRecentSample() { return new TimeStampedCounterValue(System.currentTimeMillis(), getValue()); } @Override public TimeStampedCounterValue[] getAllSampleValues() { ArrayList<TimeStampedCounterValue> arr = new ArrayList<TimeStampedCounterValue>(); for (Timestamped<Double> ts : rate.history()) { arr.add(new TimeStampedCounterValue(ts.getTimestamp(), (int) (ts.getSample().doubleValue() * ONE_HUNDRED))); } return sortAndPresent(arr); } @Override public long getValue() { return (long) (rate.value().doubleValue() * ONE_HUNDRED); } }; }
/** * {@inheritDoc} */ @Override public SampledCounter getCacheHitRatioSample() { return new SampledCounterProxy<Double>(cache.getStatistics().getExtended().cacheHitRatio()) { @Override public TimeStampedCounterValue getMostRecentSample() { return new TimeStampedCounterValue(System.currentTimeMillis(), getValue()); } @Override public TimeStampedCounterValue[] getAllSampleValues() { ArrayList<TimeStampedCounterValue> arr = new ArrayList<TimeStampedCounterValue>(); for (Timestamped<Double> ts : rate.history()) { arr.add(new TimeStampedCounterValue(ts.getTimestamp(), (int) (ts.getSample().doubleValue() * ONE_HUNDRED))); } return sortAndPresent(arr); } @Override public long getValue() { return (long) (rate.value().doubleValue() * ONE_HUNDRED); } }; }