undeprecate cache recentHitRate metrics

patch by Chris Burroughs; reviewed by benedict for CASSANDRA-6591
This commit is contained in:
Chris Burroughs 2015-06-12 12:22:30 +01:00 committed by Benedict Elliott Smith
parent b1abcd048e
commit 8c19fd638d
6 changed files with 33 additions and 5 deletions

View File

@ -5,6 +5,7 @@
* Change gossip stabilization to use endpoit size (CASSANDRA-9401)
* Change default garbage collector to G1 (CASSANDRA-7486)
* Populate TokenMetadata early during startup (CASSANDRA-9317)
* undeprecate cache recentHitRate (CASSANDRA-6591)
2.2

View File

@ -37,8 +37,14 @@ public class CacheMetrics
public final Meter hits;
/** Total number of cache requests */
public final Meter requests;
/** cache hit rate */
/** all time cache hit rate */
public final Gauge<Double> hitRate;
/** 1m hit rate */
public final Gauge<Double> oneMinuteHitRate;
/** 5m hit rate */
public final Gauge<Double> fiveMinuteHitRate;
/** 15m hit rate */
public final Gauge<Double> fifteenMinuteHitRate;
/** Total size of cache, in bytes */
public final Gauge<Long> size;
/** Total number of cache entries */
@ -71,6 +77,27 @@ public class CacheMetrics
return Ratio.of(hits.getCount(), requests.getCount());
}
});
oneMinuteHitRate = Metrics.register(factory.createMetricName("OneMinuteHitRate"), new RatioGauge()
{
protected Ratio getRatio()
{
return Ratio.of(hits.getOneMinuteRate(), requests.getOneMinuteRate());
}
});
fiveMinuteHitRate = Metrics.register(factory.createMetricName("FiveMinuteHitRate"), new RatioGauge()
{
protected Ratio getRatio()
{
return Ratio.of(hits.getFiveMinuteRate(), requests.getFiveMinuteRate());
}
});
fifteenMinuteHitRate = Metrics.register(factory.createMetricName("FifteenMinuteHitRate"), new RatioGauge()
{
protected Ratio getRatio()
{
return Ratio.of(hits.getFifteenMinuteRate(), requests.getFifteenMinuteRate());
}
});
size = Metrics.register(factory.createMetricName("Size"), new Gauge<Long>()
{
public Long getValue()

View File

@ -238,7 +238,7 @@ public class DynamicList<E>
canon.add(c);
c++;
}
FasterRandom rand = new FasterRandom();
ThreadLocalRandom rand = ThreadLocalRandom.current();
assert list.isWellFormed();
for (int loop = 0 ; loop < 100 ; loop++)
{

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cassandra.utils;
package org.apache.cassandra.stress.generate;
import java.util.Random;

View File

@ -24,7 +24,7 @@ import java.nio.ByteBuffer;
import java.util.Arrays;
import org.apache.cassandra.db.marshal.BytesType;
import org.apache.cassandra.utils.FasterRandom;
import org.apache.cassandra.stress.generate.FasterRandom;
public class Bytes extends Generator<ByteBuffer>
{

View File

@ -21,7 +21,7 @@
package org.apache.cassandra.stress.generate.values;
import org.apache.cassandra.db.marshal.UTF8Type;
import org.apache.cassandra.utils.FasterRandom;
import org.apache.cassandra.stress.generate.FasterRandom;
public class Strings extends Generator<String>
{