当前位置: 首页>>代码示例>>Java>>正文


Java CacheMetricsAction类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:23,代码来源:ExpirationKCVSCache.java

示例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());
    }
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:9,代码来源:TitanOperationCountingTest.java

示例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);
        }
    });
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:16,代码来源:MetricInstrumentedSchemaCache.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:4,代码来源:TitanOperationCountingTest.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:4,代码来源:TitanOperationCountingTest.java

示例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());
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:7,代码来源:TitanOperationCountingTest.java

示例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);
    }
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:7,代码来源:KCVSCache.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:4,代码来源:MetricInstrumentedSchemaCache.java

示例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);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:6,代码来源:MetricInstrumentedSchemaCache.java

示例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);
}
 
开发者ID:graben1437,项目名称:titan1withtp3.1,代码行数:6,代码来源:MetricInstrumentedSchemaCache.java

示例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());
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:7,代码来源:TitanOperationCountingTest.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:4,代码来源:TitanOperationCountingTest.java

示例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();
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:4,代码来源:TitanOperationCountingTest.java

示例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());
}
 
开发者ID:graben1437,项目名称:titan0.5.4-hbase1.1.1-custom,代码行数:7,代码来源:TitanOperationCountingTest.java


注:本文中的com.thinkaurelius.titan.diskstorage.util.CacheMetricsAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。