Search in sources :

Example 1 with ServiceData

use of com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData in project coherence-visualvm by oracle.

the class AbstractDataRetrieverTest method testServiceData.

/**
 * Test the retrieval of ServiceData via the VisualVMModel.
 */
public void testServiceData() {
    List<Map.Entry<Object, Data>> serviceData;
    List<Map.Entry<Object, Data>> serviceMemberData;
    VisualVMModel model = getModel();
    assertClusterReady();
    waitForRefresh();
    // refresh the statistics
    model.refreshStatistics(getRequestSender());
    serviceData = model.getData(VisualVMModel.DataType.SERVICE);
    setCurrentDataType(VisualVMModel.DataType.SERVICE);
    // the services will be ordered as above, alphabetically
    Map.Entry<Object, Data> distService1 = getData(serviceData, DIST1_SERVICE);
    Map.Entry<Object, Data> distService2 = getData(serviceData, DIST2_SERVICE);
    Map.Entry<Object, Data> extendProxyService = getData(serviceData, PROXY_SERVICE);
    Map.Entry<Object, Data> federatedService = getData(serviceData, FEDERATED_SERVICE);
    Map.Entry<Object, Data> replicatedService = getData(serviceData, REPLICATED_SERVICE);
    Assert.assertNotNull(distService1);
    Assert.assertNotNull(distService2);
    Assert.assertNotNull(extendProxyService);
    // test Federation
    if (isCommercial()) {
        Assert.assertNotNull(federatedService);
        validateColumn(ServiceData.STATUS_HA, federatedService, "NODE-SAFE");
        validateColumn(ServiceData.STORAGE_MEMBERS, federatedService, 2);
    }
    setCurrentDataType(VisualVMModel.DataType.SERVICE);
    // validate distributed caches
    validateDistributedCacheService(distService1, DIST1_SERVICE);
    validateDistributedCacheService(distService2, DIST2_SERVICE);
    // validate proxy server
    validateColumn(ServiceData.STATUS_HA, extendProxyService, "n/a");
    validateColumn(ServiceData.MEMBERS, extendProxyService, 2);
    validateColumn(ServiceData.STORAGE_MEMBERS, extendProxyService, 0);
    // validate replicated scheme
    validateColumn(ServiceData.STATUS_HA, replicatedService, "NODE-SAFE");
    validateColumn(ServiceData.STORAGE_MEMBERS, replicatedService, 2);
    // set the selected service and refresh to get ServiceMemberData
    model.setSelectedService(DIST1_SERVICE);
    assertClusterReady();
    waitForRefresh();
    // refresh the statistics
    model.refreshStatistics(getRequestSender());
    serviceMemberData = model.getData(VisualVMModel.DataType.SERVICE_DETAIL);
    setCurrentDataType(VisualVMModel.DataType.SERVICE_DETAIL);
    validateData(VisualVMModel.DataType.SERVICE_DETAIL, serviceMemberData, 2);
    // ensure we have correct values
    int nNode = 1;
    for (Map.Entry<Object, Data> entry : serviceMemberData) {
        validateColumn(ServiceMemberData.NODE_ID, entry, nNode++);
        validateColumn(ServiceMemberData.THREAD_COUNT, entry, 10);
        validateColumn(ServiceMemberData.THREAD_IDLE_COUNT, entry, 10);
        validateColumn(ServiceMemberData.THREAD_UTILISATION_PERCENT, entry, 0.0f);
    }
}
Also used : MemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.MemberData) ServiceData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData) PersistenceData(com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceData) FederationDestinationDetailsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationDestinationDetailsData) Data(com.oracle.coherence.plugin.visualvm.tablemodel.model.Data) FederationOriginDetailsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationOriginDetailsData) CacheDetailData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheDetailData) CacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData) RamJournalData(com.oracle.coherence.plugin.visualvm.tablemodel.model.RamJournalData) ServiceMemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceMemberData) FederationData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationData) ClusterData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ClusterData) ProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ProxyData) VisualVMModel(com.oracle.coherence.plugin.visualvm.VisualVMModel) Map(java.util.Map)

Example 2 with ServiceData

use of com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData in project coherence-visualvm by oracle.

the class VisualVMModel method init.

// ---- helper methods --------------------------------------------------
/**
 * Initialize anything for this instance of the model.
 */
private void init() {
    m_nRefreshTime = getRefreshTime();
    m_fLogJMXQueryTimes = isLogQueryTimes();
    String sReporterDisabled = System.getProperty(PROP_REPORTER_DISABLED);
    // version >= 12.1.3
    if ("true".equalsIgnoreCase(sReporterDisabled)) {
        setReporterAvailable(false);
    }
    // force update on first time
    m_ldtLastUpdate = System.currentTimeMillis() - m_nRefreshTime - 1L;
    // populate mapCollectedData which contains an entry for each type
    m_mapCollectedData = new HashMap<DataType, List<Entry<Object, Data>>>();
    for (DataType type : DataType.values()) {
        m_mapCollectedData.put(type, null);
    }
    // intialize the data retrievers map
    f_mapDataRetrievers.put(CacheData.class, new CacheData());
    f_mapDataRetrievers.put(ClusterData.class, new ClusterData());
    f_mapDataRetrievers.put(MemberData.class, new MemberData());
    f_mapDataRetrievers.put(ServiceData.class, new ServiceData());
    f_mapDataRetrievers.put(ServiceMemberData.class, new ServiceMemberData());
    f_mapDataRetrievers.put(ProxyData.class, new ProxyData());
    f_mapDataRetrievers.put(MachineData.class, new MachineData());
    f_mapDataRetrievers.put(CacheDetailData.class, new CacheDetailData());
    f_mapDataRetrievers.put(CacheFrontDetailData.class, new CacheFrontDetailData());
    f_mapDataRetrievers.put(TopicData.class, new TopicData());
    f_mapDataRetrievers.put(PersistenceData.class, new PersistenceData());
    f_mapDataRetrievers.put(PersistenceNotificationsData.class, new PersistenceNotificationsData());
    f_mapDataRetrievers.put(CacheStorageManagerData.class, new CacheStorageManagerData());
    f_mapDataRetrievers.put(HttpSessionData.class, new HttpSessionData());
    f_mapDataRetrievers.put(FederationDestinationData.class, new FederationDestinationData());
    f_mapDataRetrievers.put(FederationDestinationDetailsData.class, new FederationDestinationDetailsData());
    f_mapDataRetrievers.put(FederationOriginData.class, new FederationOriginData());
    f_mapDataRetrievers.put(FederationOriginDetailsData.class, new FederationOriginDetailsData());
    f_mapDataRetrievers.put(RamJournalData.class, new RamJournalData());
    f_mapDataRetrievers.put(FlashJournalData.class, new FlashJournalData());
    f_mapDataRetrievers.put(JCacheConfigurationData.class, new JCacheConfigurationData());
    f_mapDataRetrievers.put(JCacheStatisticsData.class, new JCacheStatisticsData());
    f_mapDataRetrievers.put(HttpProxyData.class, new HttpProxyData());
    f_mapDataRetrievers.put(HttpProxyMemberData.class, new HttpProxyMemberData());
    f_mapDataRetrievers.put(HotCacheData.class, new HotCacheData());
    f_mapDataRetrievers.put(HotCachePerCacheData.class, new HotCachePerCacheData());
    f_mapDataRetrievers.put(NodeStorageData.class, new NodeStorageData());
    f_mapDataRetrievers.put(ExecutorData.class, new ExecutorData());
    f_mapDataRetrievers.put(GrpcProxyData.class, new GrpcProxyData());
    // Loop through each data retriever and initialize the map of
    // report XML. Doing it this way we load it only once
    Iterator<Map.Entry<Class, DataRetriever>> iter = f_mapDataRetrievers.entrySet().iterator();
    while (iter.hasNext()) {
        Map.Entry<Class, DataRetriever> entry = iter.next();
        String sReport = entry.getValue().getReporterReport();
        if (sReport != null) {
            String sReportXML = getReportXML(sReport);
            if (sReportXML != null) {
                f_mapReportXML.put(entry.getKey(), sReportXML);
            }
        }
    }
}
Also used : PersistenceNotificationsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceNotificationsData) HttpProxyMemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpProxyMemberData) CacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData) HotCachePerCacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HotCachePerCacheData) HotCacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HotCacheData) TopicData(com.oracle.coherence.plugin.visualvm.tablemodel.model.TopicData) FederationDestinationData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationDestinationData) ServiceMemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceMemberData) HotCacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HotCacheData) HttpSessionData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpSessionData) MachineData(com.oracle.coherence.plugin.visualvm.tablemodel.model.MachineData) CacheDetailData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheDetailData) Entry(java.util.Map.Entry) HttpProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpProxyData) GrpcProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.GrpcProxyData) ProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ProxyData) CacheFrontDetailData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheFrontDetailData) HttpProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpProxyData) FederationDestinationDetailsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationDestinationDetailsData) HotCachePerCacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HotCachePerCacheData) List(java.util.List) ArrayList(java.util.ArrayList) FlashJournalData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FlashJournalData) NodeStorageData(com.oracle.coherence.plugin.visualvm.tablemodel.model.NodeStorageData) ServiceMemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceMemberData) HttpProxyMemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpProxyMemberData) MemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.MemberData) PersistenceData(com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceData) FederationOriginData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationOriginData) JCacheConfigurationData(com.oracle.coherence.plugin.visualvm.tablemodel.model.JCacheConfigurationData) GrpcProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.GrpcProxyData) NodeStorageData(com.oracle.coherence.plugin.visualvm.tablemodel.model.NodeStorageData) PersistenceData(com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceData) PersistenceNotificationsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceNotificationsData) HttpProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpProxyData) GrpcProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.GrpcProxyData) FederationOriginDetailsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationOriginDetailsData) CacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData) ServiceMemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceMemberData) FederationOriginData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationOriginData) ClusterData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ClusterData) CacheFrontDetailData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheFrontDetailData) ProxyData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ProxyData) HttpProxyMemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpProxyMemberData) HotCachePerCacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HotCachePerCacheData) MemberData(com.oracle.coherence.plugin.visualvm.tablemodel.model.MemberData) CacheStorageManagerData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheStorageManagerData) MachineData(com.oracle.coherence.plugin.visualvm.tablemodel.model.MachineData) ExecutorData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ExecutorData) ServiceData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData) HttpSessionData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HttpSessionData) JCacheConfigurationData(com.oracle.coherence.plugin.visualvm.tablemodel.model.JCacheConfigurationData) FederationDestinationDetailsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationDestinationDetailsData) JCacheStatisticsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.JCacheStatisticsData) Data(com.oracle.coherence.plugin.visualvm.tablemodel.model.Data) FlashJournalData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FlashJournalData) CacheDetailData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheDetailData) RamJournalData(com.oracle.coherence.plugin.visualvm.tablemodel.model.RamJournalData) TopicData(com.oracle.coherence.plugin.visualvm.tablemodel.model.TopicData) HotCacheData(com.oracle.coherence.plugin.visualvm.tablemodel.model.HotCacheData) FederationDestinationData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationDestinationData) DataRetriever(com.oracle.coherence.plugin.visualvm.tablemodel.model.DataRetriever) FederationOriginDetailsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationOriginDetailsData) ServiceData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData) ExecutorData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ExecutorData) CacheStorageManagerData(com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheStorageManagerData) ClusterData(com.oracle.coherence.plugin.visualvm.tablemodel.model.ClusterData) RamJournalData(com.oracle.coherence.plugin.visualvm.tablemodel.model.RamJournalData) Map(java.util.Map) SortedMap(java.util.SortedMap) HashMap(java.util.HashMap) TreeMap(java.util.TreeMap) JCacheStatisticsData(com.oracle.coherence.plugin.visualvm.tablemodel.model.JCacheStatisticsData)

Aggregations

CacheData (com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheData)2 CacheDetailData (com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheDetailData)2 ClusterData (com.oracle.coherence.plugin.visualvm.tablemodel.model.ClusterData)2 Data (com.oracle.coherence.plugin.visualvm.tablemodel.model.Data)2 FederationDestinationDetailsData (com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationDestinationDetailsData)2 FederationOriginDetailsData (com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationOriginDetailsData)2 MemberData (com.oracle.coherence.plugin.visualvm.tablemodel.model.MemberData)2 PersistenceData (com.oracle.coherence.plugin.visualvm.tablemodel.model.PersistenceData)2 ProxyData (com.oracle.coherence.plugin.visualvm.tablemodel.model.ProxyData)2 RamJournalData (com.oracle.coherence.plugin.visualvm.tablemodel.model.RamJournalData)2 ServiceData (com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceData)2 ServiceMemberData (com.oracle.coherence.plugin.visualvm.tablemodel.model.ServiceMemberData)2 Map (java.util.Map)2 VisualVMModel (com.oracle.coherence.plugin.visualvm.VisualVMModel)1 CacheFrontDetailData (com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheFrontDetailData)1 CacheStorageManagerData (com.oracle.coherence.plugin.visualvm.tablemodel.model.CacheStorageManagerData)1 DataRetriever (com.oracle.coherence.plugin.visualvm.tablemodel.model.DataRetriever)1 ExecutorData (com.oracle.coherence.plugin.visualvm.tablemodel.model.ExecutorData)1 FederationData (com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationData)1 FederationDestinationData (com.oracle.coherence.plugin.visualvm.tablemodel.model.FederationDestinationData)1