Search in sources :

Example 6 with Description

use of org.glassfish.gmbal.Description 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 7 with Description

use of org.glassfish.gmbal.Description 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 8 with Description

use of org.glassfish.gmbal.Description 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)

Example 9 with Description

use of org.glassfish.gmbal.Description in project Payara by payara.

the class ConnectionQueueStatsProvider method getCountQueued1MinuteAverage.

@ManagedAttribute(id = "countqueued1minuteaverage")
@Description("Average number of connections queued in the last 1 minute")
public CountStatistic getCountQueued1MinuteAverage() {
    final CountStatisticImpl stats = new CountStatisticImpl("CountQueued1MinuteAverage", "count", "Average number of connections queued in the last 1 minute");
    stats.setCount(getAverageBy(1));
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 10 with Description

use of org.glassfish.gmbal.Description in project Payara by payara.

the class ConnectionQueueStatsProvider method getCountQueued5MinutesAverage.

@ManagedAttribute(id = "countqueued5minutesaverage")
@Description("Average number of connections queued in the last 5 minutes")
public CountStatistic getCountQueued5MinutesAverage() {
    final CountStatisticImpl stats = new CountStatisticImpl("CountQueued5MinutesAverage", "count", "Average number of connections queued in the last 5 minutes");
    stats.setCount(getAverageBy(5));
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Aggregations

Description (org.glassfish.gmbal.Description)12 ManagedAttribute (org.glassfish.gmbal.ManagedAttribute)12 CountStatisticImpl (org.glassfish.external.statistics.impl.CountStatisticImpl)9 GarbageCollectorMXBean (java.lang.management.GarbageCollectorMXBean)2 TransactionAdminBean (com.sun.enterprise.transaction.api.TransactionAdminBean)1 List (java.util.List)1