Package com.sun.sgs.profile

Examples of com.sun.sgs.profile.ProfileCollector


    }
       
    @Test
    public void testSample() throws Exception {
        final String name = "sample";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        // Register a counter to be noted at all profiling levels
        final ProfileSample sample =
            cons1.createSample(name, testType, ProfileLevel.MIN);

        // Because the listener is running in a different thread, JUnit
View Full Code Here


    }
           
    @Test
    public void testSampleLevel() throws Exception {
        final String name = "MySamples";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("cons1");
        final ProfileSample sample =
            cons1.createSample(name, testType, ProfileLevel.MAX);
       
        // Because the listener is running in a different thread, JUnit
        // is not able to report the assertions and failures.
View Full Code Here

    }
   
    @Test
    public void testSampleLevelChange() throws Exception {
        final String name = "samples";
        ProfileCollector collector = getCollector(serverNode);
        final ProfileConsumer cons1 = collector.getConsumer("c1");
        final ProfileSample sample =
            cons1.createSample(name, testType, ProfileLevel.MAX);

        // Because the listener is running in a different thread, JUnit
        // is not able to report the assertions and failures.
View Full Code Here

            timesyncInterval = wrappedProps.getLongProperty(
                    TIMESYNC_INTERVAL_PROPERTY, DEFAULT_TIMESYNC_INTERVAL,
                    1000, Long.MAX_VALUE);

            // create our profiling info and register our MBean
            ProfileCollector collector =
                systemRegistry.getComponent(ProfileCollector.class);
            serviceStats = new WatchdogServiceStats(collector, this);
            try {
                collector.registerMBean(serviceStats,
                                        WatchdogServiceStats.MXBEAN_NAME);
            } catch (JMException e) {
                logger.logThrow(Level.CONFIG, e, "Could not register MBean");
            }
            // set our data in the ConfigMXBean
            ConfigManager config = (ConfigManager)
                    collector.getRegisteredMBean(ConfigManager.MXBEAN_NAME);
            if (config == null) {
                logger.log(Level.CONFIG, "Could not find ConfigMXBean");
            } else {
                config.setJmxPort(jmxPort);
            }
View Full Code Here

            fullName = "NodeMappingServiceImpl[host:" + localHost +
                       ", clientPort:" + clientPort +
                       ", fullStack:" + fullStack + "]";
           
            // create our profiling info and register our MBean
            ProfileCollector collector =
                systemRegistry.getComponent(ProfileCollector.class);
            serviceStats = new NodeMappingServiceStats(collector);
            try {
                collector.registerMBean(serviceStats,
                                        NodeMappingServiceMXBean.MXBEAN_NAME);
            } catch (JMException e) {
                logger.logThrow(Level.CONFIG, e, "Could not register MBean");
            }
View Full Code Here

      } else {
    baseStore = new DataStoreClient(
        properties, systemRegistry, txnProxy);
      }
            storeToShutdown = baseStore;
            ProfileCollector collector =
    systemRegistry.getComponent(ProfileCollector.class);
      store = new DataStoreProfileProducer(baseStore, collector);
      nodeId = store.getLocalNodeId();
           
            // create our service profiling info and register our MBean
            serviceStats = new DataServiceStats(collector);
            try {
                collector.registerMBean(serviceStats,
                                        DataServiceStats.MXBEAN_NAME);
            } catch (JMException e) {
                logger.logThrow(Level.CONFIG, e, "Could not register MBean");
            }
View Full Code Here

            UndirectedGraph<LabelVertex, WeightedEdge> graph =
                    serverBuilder.getAffinityGraph();
            System.out.println("GRAPH IS " + graph);
            Assert.assertEquals(34, graph.getVertexCount());
            Assert.assertEquals(78, graph.getEdgeCount());
            ProfileCollector col =
                serverNode.getSystemRegistry().
                    getComponent(ProfileCollector.class);
            AffinityGroupFinderMXBean bean = (AffinityGroupFinderMXBean)
                col.getRegisteredMBean(AffinityGroupFinderMXBean.MXBEAN_NAME);
            assertNotNull(bean);
            bean.clear();

            // Be sure the consumer is turned on
            col.getConsumer(AffinityGroupFinderStats.CONS_NAME).
                    setProfileLevel(ProfileLevel.MAX);
            double avgMod = 0.0;
            double maxMod = 0.0;
            double minMod = 1.0;
            for (int i = 0; i < RUNS; i++) {
View Full Code Here

    }
   
   @Test
    public void testAggregateProfileCounter() throws Exception {
        final String name = "counter";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        // Register a counter to be noted at all profiling levels
        final AggregateProfileCounter counter =
                (AggregateProfileCounter)
                    cons1.createCounter(name, testType, ProfileLevel.MIN);
       
View Full Code Here

    }
  
   @Test
   public void testAggregateProfileOperation() throws Exception {
        final String name = "operation";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        final AggregateProfileOperation op =
                (AggregateProfileOperation)
                    cons1.createOperation(name, testType, ProfileLevel.MIN);
       
        op.report();
View Full Code Here

        assertEquals(1, op.getCount());
   }
  
   @Test(expected=IllegalArgumentException.class)
   public void testAggregateProfileNegSmoothing() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        final AggregateProfileSample samp =
                (AggregateProfileSample)
                    cons1.createSample("foo", testType, ProfileLevel.MIN);
        samp.setSmoothingFactor(-1.1);
   }
View Full Code Here

TOP

Related Classes of com.sun.sgs.profile.ProfileCollector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.