本文整理汇总了Java中com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction类的典型用法代码示例。如果您正苦于以下问题:Java CacheMetricsAction类的具体用法?Java CacheMetricsAction怎么用?Java CacheMetricsAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CacheMetricsAction类属于com.thinkaurelius.titan.diskstorage.util包,在下文中一共展示了CacheMetricsAction类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSlice
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
@Override
public EntryList getSlice(final KeySliceQuery query, final StoreTransaction txh) throws BackendException {
incActionBy(1, CacheMetricsAction.RETRIEVAL,txh);
if (isExpired(query)) {
incActionBy(1, CacheMetricsAction.MISS,txh);
return store.getSlice(query, unwrapTx(txh));
}
try {
return cache.get(query,new Callable<EntryList>() {
@Override
public EntryList call() throws Exception {
incActionBy(1, CacheMetricsAction.MISS,txh);
return store.getSlice(query, unwrapTx(txh));
}
});
} catch (Exception e) {
if (e instanceof TitanException) throw (TitanException)e;
else if (e.getCause() instanceof TitanException) throw (TitanException)e.getCause();
else throw new TitanException(e);
}
}
示例2: verifyTypeCacheMetrics
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
public void verifyTypeCacheMetrics(String prefix, int nameMisses, int relationMisses) {
// assertEquals("On type cache name retrievals",nameRetrievals, metric.getCounter(GraphDatabaseConfiguration.METRICS_SYSTEM_PREFIX_DEFAULT, METRICS_NAME, METRICS_TYPENAME, CacheMetricsAction.RETRIEVAL.getName()).getCount());
assertEquals("On type cache name misses",nameMisses, metric.getCounter(GraphDatabaseConfiguration.METRICS_SYSTEM_PREFIX_DEFAULT, METRICS_NAME, METRICS_TYPENAME, CacheMetricsAction.MISS.getName()).getCount());
assertTrue(nameMisses <= metric.getCounter(GraphDatabaseConfiguration.METRICS_SYSTEM_PREFIX_DEFAULT, METRICS_NAME, METRICS_TYPENAME, CacheMetricsAction.RETRIEVAL.getName()).getCount());
// assertEquals("On type cache relation retrievals",relationRetrievals, metric.getCounter(GraphDatabaseConfiguration.METRICS_SYSTEM_PREFIX_DEFAULT, METRICS_NAME, METRICS_RELATIONS, CacheMetricsAction.RETRIEVAL.getName()).getCount());
assertEquals("On type cache relation misses", relationMisses, metric.getCounter(GraphDatabaseConfiguration.METRICS_SYSTEM_PREFIX_DEFAULT, METRICS_NAME, METRICS_RELATIONS, CacheMetricsAction.MISS.getName()).getCount());
assertTrue(relationMisses <= metric.getCounter(GraphDatabaseConfiguration.METRICS_SYSTEM_PREFIX_DEFAULT, METRICS_NAME, METRICS_RELATIONS, CacheMetricsAction.RETRIEVAL.getName()).getCount());
}
示例3: MetricInstrumentedSchemaCache
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
public MetricInstrumentedSchemaCache(final StoreRetrieval retriever) {
cache = new StandardSchemaCache(new StoreRetrieval() {
@Override
public Long retrieveSchemaByName(String typeName) {
incAction(METRICS_TYPENAME,CacheMetricsAction.MISS);
return retriever.retrieveSchemaByName(typeName);
}
@Override
public EntryList retrieveSchemaRelations(long schemaId, BaseRelationType type, Direction dir) {
incAction(METRICS_RELATIONS,CacheMetricsAction.MISS);
return retriever.retrieveSchemaRelations(schemaId, type, dir);
}
});
}
示例4: getEdgeCacheRetrievals
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
private long getEdgeCacheRetrievals() {
return metric.getCounter(metricsPrefix, EDGESTORE_NAME + METRICS_CACHE_SUFFIX, CacheMetricsAction.RETRIEVAL.getName()).getCount();
}
示例5: getEdgeCacheMisses
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
private long getEdgeCacheMisses() {
return metric.getCounter(metricsPrefix, EDGESTORE_NAME + METRICS_CACHE_SUFFIX, CacheMetricsAction.MISS.getName()).getCount();
}
示例6: resetEdgeCacheCounts
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
private void resetEdgeCacheCounts() {
Counter counter = metric.getCounter(metricsPrefix, EDGESTORE_NAME + METRICS_CACHE_SUFFIX, CacheMetricsAction.RETRIEVAL.getName());
counter.dec(counter.getCount());
counter = metric.getCounter(metricsPrefix, EDGESTORE_NAME + METRICS_CACHE_SUFFIX, CacheMetricsAction.MISS.getName());
counter.dec(counter.getCount());
}
示例7: incActionBy
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
protected void incActionBy(int by, CacheMetricsAction action, StoreTransaction txh) {
assert by>=1;
if (metricsName!=null && txh.getConfiguration().hasGroupName()) {
MetricManager.INSTANCE.getCounter(txh.getConfiguration().getGroupName(), metricsName, action.getName()).inc(by);
}
}
示例8: incAction
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
private void incAction(String type, CacheMetricsAction action) {
MetricManager.INSTANCE.getCounter(GraphDatabaseConfiguration.METRICS_SYSTEM_PREFIX_DEFAULT, METRICS_NAME, type, action.getName()).inc();
}
示例9: getSchemaId
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
@Override
public Long getSchemaId(String schemaName) {
incAction(METRICS_TYPENAME,CacheMetricsAction.RETRIEVAL);
return cache.getSchemaId(schemaName);
}
示例10: getSchemaRelations
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
@Override
public EntryList getSchemaRelations(long schemaId, BaseRelationType type, Direction dir) {
incAction(METRICS_RELATIONS,CacheMetricsAction.RETRIEVAL);
return cache.getSchemaRelations(schemaId, type, dir);
}
示例11: verifyTypeCacheMetrics
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
public void verifyTypeCacheMetrics(String prefix, int nameRetrievals, int nameMisses, int relationRetrievals, int relationMisses) {
assertEquals("On type cache name retrievals",nameRetrievals, metric.getCounter(prefix, METRICS_NAME, METRICS_TYPENAME, CacheMetricsAction.RETRIEVAL.getName()).getCount());
assertEquals("On type cache name misses",nameMisses, metric.getCounter(prefix, METRICS_NAME, METRICS_TYPENAME, CacheMetricsAction.MISS.getName()).getCount());
assertEquals("On type cache relation retrievals",relationRetrievals, metric.getCounter(prefix, METRICS_NAME, METRICS_RELATIONS, CacheMetricsAction.RETRIEVAL.getName()).getCount());
assertEquals("On type cache relation misses", relationMisses, metric.getCounter(prefix, METRICS_NAME, METRICS_RELATIONS, CacheMetricsAction.MISS.getName()).getCount());
}
示例12: getEdgeCacheRetrievals
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
private long getEdgeCacheRetrievals() {
return MetricManager.INSTANCE.getCounter(metricsPrefix, "edgeStore" + Backend.METRICS_CACHE_SUFFIX, CacheMetricsAction.RETRIEVAL.getName()).getCount();
}
示例13: getEdgeCacheMisses
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
private long getEdgeCacheMisses() {
return MetricManager.INSTANCE.getCounter(metricsPrefix, "edgeStore" + Backend.METRICS_CACHE_SUFFIX, CacheMetricsAction.MISS.getName()).getCount();
}
示例14: resetEdgeCacheCounts
import com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction; //导入依赖的package包/类
private void resetEdgeCacheCounts() {
Counter counter = MetricManager.INSTANCE.getCounter(metricsPrefix, "edgeStore" + Backend.METRICS_CACHE_SUFFIX, CacheMetricsAction.RETRIEVAL.getName());
counter.dec(counter.getCount());
counter = MetricManager.INSTANCE.getCounter(metricsPrefix, "edgeStore" + Backend.METRICS_CACHE_SUFFIX, CacheMetricsAction.MISS.getName());
counter.dec(counter.getCount());
}