Search in sources :

Example 6 with ManagedAttribute

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;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 7 with ManagedAttribute

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;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 8 with ManagedAttribute

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;
}
Also used : SlowSqlTrace(fish.payara.jdbc.stats.SlowSqlTrace) CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 9 with ManagedAttribute

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;
}
Also used : TransactionAdminBean(com.sun.enterprise.transaction.api.TransactionAdminBean) List(java.util.List) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 10 with ManagedAttribute

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;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Aggregations

ManagedAttribute (org.glassfish.gmbal.ManagedAttribute)15 Description (org.glassfish.gmbal.Description)12 CountStatisticImpl (org.glassfish.external.statistics.impl.CountStatisticImpl)11 GarbageCollectorMXBean (java.lang.management.GarbageCollectorMXBean)2 TransactionAdminBean (com.sun.enterprise.transaction.api.TransactionAdminBean)1 SQLTrace (com.sun.gjc.util.SQLTrace)1 SlowSqlTrace (fish.payara.jdbc.stats.SlowSqlTrace)1 Method (java.lang.reflect.Method)1 List (java.util.List)1 StatsProviderRegistryElement (org.glassfish.admin.monitor.StatsProviderRegistry.StatsProviderRegistryElement)1 Reset (org.glassfish.external.statistics.annotations.Reset)1 ListStatisticImpl (org.glassfish.external.statistics.impl.ListStatisticImpl)1 TreeNode (org.glassfish.flashlight.datatree.TreeNode)1