use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.
the class FileCacheStatsProvider method getMaxMappedMemorySize.
@ManagedAttribute(id = "maxmappedmemorysize")
@Description("Maximum memory map size used for caching")
public CountStatistic getMaxMappedMemorySize() {
final CountStatisticImpl stats = new CountStatisticImpl("MaxMappedMemorySize", "byte(s)", "Maximum memory map size used for caching");
stats.setCount(maxMappedMemorySize.get());
return stats;
}
use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.
the class KeepAliveStatsProvider method getFlushesCount.
@ManagedAttribute(id = "countflushes")
@Description("Number of keep-alive connections that were closed")
public CountStatistic getFlushesCount() {
final CountStatisticImpl stats = new CountStatisticImpl("CountFlushes", "count", "Number of keep-alive connections that were closed");
stats.setCount(Math.max(0, totalKeepAliveConnectionsCount.getCount() - timeoutsCount.getCount()));
return stats;
}
use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.
the class JdbcStatsProvider method getSlowSqlQueries.
@ManagedAttribute(id = "slowSqlQueries")
public ListStatistic getSlowSqlQueries() {
// Make sure no data from previous execution is kept
slowSqlQueries.reset();
slowSqlQueries.clear();
// Get slow queries and process them
List<SlowSqlTrace> slowTraces = slowSqlTraceCache.getSlowestSqlQueries();
for (SlowSqlTrace trace : slowTraces) {
CountStatisticImpl stat = new CountStatisticImpl(trace.getQueryName(), StatisticImpl.UNIT_MILLISECOND, "Longest execution time");
stat.setCount(trace.getSlowestExecutionTime());
slowSqlQueries.add(stat);
}
return slowSqlQueries;
}
use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.
the class TransactionServiceStatsProvider method getActiveIds.
@ManagedAttribute(id = "activeids")
@Description("List of inflight transactions.")
public StringStatistic getActiveIds() {
if (txMgr == null) {
_logger.warning("transaction.monitor.tm_null");
inflightTransactions.setCurrent("");
return inflightTransactions;
}
List aList = txMgr.getActiveTransactions();
StringBuffer strBuf = new StringBuffer(1024);
if (!aList.isEmpty()) {
// Set the headings for the tabular output
int componentNameLength = COLUMN_LENGTH;
int txIdLength = COLUMN_LENGTH + 15;
for (int i = 0; i < aList.size(); i++) {
TransactionAdminBean txnBean = (TransactionAdminBean) aList.get(i);
String componentName = txnBean.getComponentName();
if (componentName.length() > componentNameLength) {
componentNameLength = componentName.length() + 1;
}
String txnId = txnBean.getId();
if (txnId.length() > txIdLength) {
txIdLength = txnId.length() + 1;
}
}
if (aList.size() > 0) {
strBuf.append(LINE_BREAK).append(LINE_BREAK);
appendColumn(strBuf, "Transaction Id", txIdLength);
appendColumn(strBuf, "Status", COLUMN_LENGTH);
appendColumn(strBuf, "ElapsedTime(ms)", COLUMN_LENGTH);
appendColumn(strBuf, "ComponentName", componentNameLength);
strBuf.append("ResourceNames ").append(LINE_BREAK);
}
for (int i = 0; i < aList.size(); i++) {
TransactionAdminBean txnBean = (TransactionAdminBean) aList.get(i);
String txnId = txnBean.getId();
_logger.fine("=== Processing txnId: " + txnId);
appendColumn(strBuf, txnId, txIdLength);
appendColumn(strBuf, txnBean.getStatus(), COLUMN_LENGTH);
appendColumn(strBuf, String.valueOf(txnBean.getElapsedTime()), COLUMN_LENGTH);
appendColumn(strBuf, txnBean.getComponentName(), componentNameLength);
List<String> resourceList = txnBean.getResourceNames();
if (resourceList != null) {
for (int k = 0; k < resourceList.size(); k++) {
if (k != 0)
strBuf.append(",");
strBuf.append(resourceList.get(k));
}
}
strBuf.append(LINE_BREAK);
}
}
_logger.fine("Prepared inflightTransactions text: \n" + strBuf);
inflightTransactions.setCurrent(strBuf.toString());
return inflightTransactions;
}
use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.
the class ConnectionQueueStatsProvider method getCountQueued15MinutesAverage.
@ManagedAttribute(id = "countqueued15minutesaverage")
@Description("Average number of connections queued in the last 15 minutes")
public CountStatistic getCountQueued15MinutesAverage() {
final CountStatisticImpl stats = new CountStatisticImpl("CountQueued15MinutesAverage", "count", "Average number of connections queued in the last 15 minutes");
stats.setCount(getAverageBy(15));
return stats;
}
Aggregations