本文整理了Java中com.yammer.metrics.core.Counter.dec()
方法的一些代码示例,展示了Counter.dec()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Counter.dec()
方法的具体详情如下:
包路径:com.yammer.metrics.core.Counter
类名称:Counter
方法名:dec
[英]Decrement the counter by one.
[中]将计数器减量1。
代码示例来源:origin: lealone/Lealone
@Override
protected void onFinalRejection(Runnable task) {
metrics.currentBlocked.dec();
}
}
代码示例来源:origin: lealone/Lealone
@Override
protected void onFinalAccept(Runnable task) {
metrics.currentBlocked.dec();
}
代码示例来源:origin: com.yammer.metrics/metrics-core
/**
* Decrement the counter by one.
*/
public void dec() {
dec(1);
}
代码示例来源:origin: io.netty/netty-metrics-yammer
@Override
public void decr(final long delta) {
delegate.dec(delta);
}
代码示例来源:origin: io.netty/netty-metrics-yammer
@Override
public void decr() {
delegate.dec();
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
@Override
protected void onFinalAccept(Runnable task)
{
metrics.currentBlocked.dec();
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
@Override
protected void onFinalRejection(Runnable task)
{
metrics.currentBlocked.dec();
}
}
代码示例来源:origin: addthis/hydra
@Override
public void close() throws IOException {
super.close();
currentlyOpenEngines.dec();
}
代码示例来源:origin: addthis/hydra
public QueryRequest takeQuery() throws InterruptedException {
QueryRequest request = blockingQueue.take();
queueTimer.update(System.currentTimeMillis() - request.queueStartTime, TimeUnit.MILLISECONDS);
queueCount.dec();
return request;
}
}
代码示例来源:origin: com.cerner.common.kafka/common-kafka
@Override
public void close() throws IOException {
// This method does not throw a KafkaException
if (consumer.paused().contains(topicPartition))
PAUSED_PARTITIONS.dec();
}
}
代码示例来源:origin: com.wavefront/proxy
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
activeConnections.dec();
super.channelInactive(ctx);
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
private void removeOldSSTablesSize(Iterable<SSTableReader> oldSSTables)
{
for (SSTableReader sstable : oldSSTables)
{
if (logger.isDebugEnabled())
logger.debug(String.format("removing %s from list of files tracked for %s.%s",
sstable.descriptor, cfstore.keyspace.getName(), cfstore.name));
long size = sstable.bytesOnDisk();
StorageMetrics.load.dec(size);
cfstore.metric.liveDiskSpaceUsed.dec(size);
}
}
代码示例来源:origin: wavefrontHQ/java
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
activeConnections.dec();
super.channelInactive(ctx);
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public void run()
{
try
{
runMayThrow();
}
catch (Exception e)
{
throw new RuntimeException(e);
}
finally
{
StorageMetrics.totalHintsInProgress.dec();
getHintsInProgressFor(target).decrementAndGet();
}
}
代码示例来源:origin: addthis/hydra
void close(boolean wasEnd) throws IOException {
if (!closed) {
mark.setEnd(wasEnd);
input.close();
mark.update(stream);
markDB.put(dbKey, mark);
log.debug("mark.save {}:{} / {}", dbKey, mark, stream);
closed = true;
reading.dec();
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public void run()
{
// If we can't successfully delete the DATA component, set the task to be retried later: see above
File datafile = new File(desc.filenameFor(Component.DATA));
if (!datafile.delete())
{
logger.error("Unable to delete {} (it will be removed on server restart; we'll also retry after GC)", datafile);
failedTasks.add(this);
return;
}
// let the remainder be cleaned up by delete
SSTable.delete(desc, Sets.difference(components, Collections.singleton(Component.DATA)));
if (totalDiskSpaceUsed != null)
totalDiskSpaceUsed.dec(bytesOnDisk);
}
代码示例来源:origin: neilbeveridge/zuul-netty
@Override
public void destroyObject(ChannelFuture future) throws Exception {
LOG.debug("destroying connection {}", Integer.toHexString(future.getChannel().getId()));
// if an error has closed the channel already Netty incorrectly throws an
// exception without this check see https://github.com/netty/netty/issues/724
if (future.getChannel().isOpen()) {
future.getChannel().close();
}
if (future.isSuccess()) {
aliveConnections.dec();
}
}
代码示例来源:origin: com.wavefront/proxy
protected void startWriteHttpJsonListener(String strPort) {
if (tokenAuthenticator.authRequired()) {
logger.warning("Port " + strPort + " (writeHttpJson) is not compatible with HTTP authentication, ignoring");
return;
}
preprocessors.forPort(strPort).forReportPoint()
.addFilter(new ReportPointTimestampInRangeFilter(dataBackfillCutoffHours, dataPrefillCutoffHours));
startAsManagedThread(() -> {
activeListeners.inc();
try {
org.eclipse.jetty.server.Server server = new org.eclipse.jetty.server.Server(Integer.parseInt(strPort));
server.setHandler(new WriteHttpJsonMetricsEndpoint(strPort, hostname, prefix,
pushValidationLevel, pushBlockedSamples, getFlushTasks(strPort), preprocessors.forPort(strPort)));
server.start();
server.join();
} catch (InterruptedException e) {
logger.warning("WriteHttpJson server interrupted.");
} catch (Exception e) {
if (e instanceof BindException) {
bindErrors.inc();
logger.severe("Unable to start listener - port " + String.valueOf(strPort) + " is already in use!");
} else {
logger.log(Level.SEVERE, "WriteHttpJson exception", e);
}
} finally {
activeListeners.dec();
}
}, "listener-plaintext-writehttpjson-" + strPort);
}
代码示例来源:origin: com.wavefront/proxy
protected void startJsonListener(String strPort) {
if (tokenAuthenticator.authRequired()) {
logger.warning("Port " + strPort + " (jsonListener) is not compatible with HTTP authentication, ignoring");
return;
}
preprocessors.forPort(strPort).forReportPoint()
.addFilter(new ReportPointTimestampInRangeFilter(dataBackfillCutoffHours, dataPrefillCutoffHours));
startAsManagedThread(() -> {
activeListeners.inc();
try {
org.eclipse.jetty.server.Server server = new org.eclipse.jetty.server.Server(Integer.parseInt(strPort));
server.setHandler(new JsonMetricsEndpoint(strPort, hostname, prefix,
pushValidationLevel, pushBlockedSamples, getFlushTasks(strPort), preprocessors.forPort(strPort)));
server.start();
server.join();
} catch (InterruptedException e) {
logger.warning("Http Json server interrupted.");
} catch (Exception e) {
if (e instanceof BindException) {
bindErrors.inc();
logger.severe("Unable to start listener - port " + String.valueOf(strPort) + " is already in use!");
} else {
logger.log(Level.SEVERE, "HttpJson exception", e);
}
} finally {
activeListeners.dec();
}
}, "listener-plaintext-json-" + strPort);
}
代码示例来源:origin: com.yammer.metrics/metrics-web
@Override
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain) throws IOException, ServletException {
final StatusExposingServletResponse wrappedResponse =
new StatusExposingServletResponse((HttpServletResponse) response);
activeRequests.inc();
final TimerContext context = requestTimer.time();
try {
chain.doFilter(request, wrappedResponse);
} finally {
context.stop();
activeRequests.dec();
markMeterForStatusCode(wrappedResponse.getStatus());
}
}
内容来源于网络,如有侵权,请联系作者删除!