public final class CacheStatisticManager extends Object
Constructor and Description |
---|
CacheStatisticManager(Configuration configuration,
TimeService timeService) |
Modifier and Type | Method and Description |
---|---|
void |
add(ExtendedStatistic stat,
double value,
GlobalTransaction globalTransaction,
boolean local)
Adds a value to a statistic.
|
void |
beginTransaction(GlobalTransaction globalTransaction,
boolean local)
Signals the start of a transaction.
|
String |
dumpCacheStatistics() |
void |
dumpCacheStatisticsTo(PrintStream stream)
Prints the cache statistics values to a
PrintStream . |
double |
getAttribute(ExtendedStatistic stat) |
double |
getPercentile(PercentileStatistic stat,
int percentile) |
boolean |
hasPendingTransactions() |
void |
increment(ExtendedStatistic stat,
GlobalTransaction globalTransaction,
boolean local)
Increments the statistic value.
|
void |
markAsWriteTransaction(GlobalTransaction globalTransaction,
boolean local)
Marks the transaction as a write transaction (instead of a read only transaction)
|
void |
onPrepareCommand(GlobalTransaction globalTransaction,
boolean local)
Invoked when a
PrepareCommand is received for a transaction. |
void |
reset()
Resets the cache statistics collected so far.
|
void |
setTransactionOutcome(boolean commit,
GlobalTransaction globalTransaction,
boolean local)
Sets the transaction outcome to commit or rollback, depending if the transaction has commit successfully or not
respectively.
|
void |
terminateTransaction(GlobalTransaction globalTransaction,
boolean local,
boolean remote)
Signals the ending of a transaction.
|
public CacheStatisticManager(Configuration configuration, TimeService timeService)
public final void add(ExtendedStatistic stat, double value, GlobalTransaction globalTransaction, boolean local)
globalTransaction
- the global transaction in which the statistics was updatedlocal
- true
if measurement occurred in a local context.public final void increment(ExtendedStatistic stat, GlobalTransaction globalTransaction, boolean local)
add(stat, 1, globalTransaction, local)
.globalTransaction
- the global transaction in which the statistics was updatedlocal
- true
if measurement occurred in a local context.public final void onPrepareCommand(GlobalTransaction globalTransaction, boolean local)
PrepareCommand
is received for a transaction.globalTransaction
- the global transaction to be prepared.local
- true
if measurement occurred in a local context.public final void setTransactionOutcome(boolean commit, GlobalTransaction globalTransaction, boolean local)
commit
- true
if the transaction has committed successfully.globalTransaction
- the terminated global transaction.local
- true
if measurement occurred in a local context.public final double getAttribute(ExtendedStatistic stat) throws ExtendedStatisticNotFoundException
ExtendedStatisticNotFoundException
- if the statistic is not found.public final double getPercentile(PercentileStatistic stat, int percentile) throws IllegalArgumentException
IllegalArgumentException
- if the percentile request is not in the correct bounds (]0,100[)public final void markAsWriteTransaction(GlobalTransaction globalTransaction, boolean local)
local
- true
if it is a local transaction.public final void beginTransaction(GlobalTransaction globalTransaction, boolean local)
local
- true
if the transaction is local.public final void terminateTransaction(GlobalTransaction globalTransaction, boolean local, boolean remote)
local
- true
if the transaction is local.remote
- true
if the transaction is remote.public final void reset()
public final boolean hasPendingTransactions()
true
if it has some transaction pending, i.e., transaction in which the statistics can be
updated.public final String dumpCacheStatistics()
public final void dumpCacheStatisticsTo(PrintStream stream)
PrintStream
.Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.