Package com.sun.sgs.profile

Examples of com.sun.sgs.profile.ProfileCollector


                renewInterval = values[1];
            }
            renewThread.start();
           
            // 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


     */
    public SampleJMXListener(Properties properties, Identity owner,
                                 ComponentRegistry registry)
    {
        // Find the MBean which collects our overall task statistics
        ProfileCollector collector =
                registry.getComponent(ProfileCollector.class);
        taskBean = (TaskAggregateMXBean)
                collector.getRegisteredMBean(TaskAggregateMXBean.MXBEAN_NAME);
        if (taskBean == null) {
            // The bean hasn't been registerd yet.  This is unexpected,
            // so throw an exception to indicate we're in a bad state.
            throw
               new IllegalStateException("Could not find task aggregate mbean");
        }
       
        // Ensure that the taskBean statistics are being generated.
        // This means we don't have to enable a default profiling level
        // through a property at start-up.
        // Because consumer names aren't publically declared in a way that
        // makes them easy to find programmatically, we make a best guess
        // search here.
        Map<String, ProfileConsumer> consumers = collector.getConsumers();
        for (Map.Entry<String, ProfileConsumer> entry : consumers.entrySet()) {
            if (entry.getKey().contains("TaskAggregate")) {
                ProfileConsumer taskConsumer = entry.getValue();
                taskConsumer.setProfileLevel(ProfileLevel.MAX);
                break;
View Full Code Here

  }
               
        // Create the node manager MBean and register it.  This must be
        // done before regiseterNode is called.
        ProfileCollector collector =
            systemRegistry.getComponent(ProfileCollector.class);
        nodeMgr = new NodeManager(this);
        try {
            collector.registerMBean(nodeMgr, NodeManager.MXBEAN_NAME);
        } catch (JMException e) {
            logger.logThrow(Level.CONFIG, e, "Could not register MBean");
        }
       
        // register our local id
View Full Code Here

        properties, accessCoordinator, scheduler);
      } else {
    baseStore = new DataStoreClient(properties, accessCoordinator);
      }
            storeToShutdown = baseStore;
            ProfileCollector collector =
    systemRegistry.getComponent(ProfileCollector.class);
      store = new DataStoreProfileProducer(baseStore, collector);
           
            // 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

        properties, systemRegistry, txnProxy);
     
      assert protocolAcceptor != null;
           
            /* Create our service profiling info and register our MBean */
            ProfileCollector collector =
    systemRegistry.getComponent(ProfileCollector.class);
            serviceStats = new ClientSessionServiceStats(collector);
            try {
                collector.registerMBean(serviceStats,
                                        ClientSessionServiceStats.MXBEAN_NAME);
            } catch (JMException e) {
                logger.logThrow(Level.CONFIG, e, "Could not register MBean");
            }
           
            /* Set the protocol descriptor in the ConfigMXBean. */
            ConfigManager config = (ConfigManager)
                    collector.getRegisteredMBean(ConfigManager.MXBEAN_NAME);
            if (config == null) {
                logger.log(Level.CONFIG, "Could not find ConfigMXBean");
            } else {
                config.setProtocolDescriptor(
        protocolAcceptor.getDescriptor().toString());
View Full Code Here

            throw new IllegalStateException("Handoff Period property must " +
                                            "be non-negative");
        }

        // create our profiling info and register our MBean
        ProfileCollector collector =
            systemRegistry.getComponent(ProfileCollector.class);
        serviceStats = new TaskServiceStats(collector);
        try {
            collector.registerMBean(serviceStats, TaskServiceStats.MXBEAN_NAME);
        } catch (JMException e) {
            logger.logThrow(Level.CONFIG, e, "Could not register MBean");
        }

        // finally, create a timer for delaying the status votes and get
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

            sessionService.registerSessionDisconnectListener(
                new ChannelSessionDisconnectListener());

            /* Create our service profiling info and register our MBean. */
            ProfileCollector collector =
    systemRegistry.getComponent(ProfileCollector.class);
            serviceStats = new ChannelServiceStats(collector);
            try {
                collector.registerMBean(serviceStats,
                                        ChannelServiceStats.MXBEAN_NAME);
            } catch (JMException e) {
                logger.logThrow(Level.CONFIG, e, "Could not register MBean");
            }

View Full Code Here

   
    /* -- counter tests -- */
    @Test
    public void testCounter() 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 ProfileCounter counter =
                cons1.createCounter(name, testType, ProfileLevel.MIN);  
       
        // Because the listener is running in a different thread, JUnit
View Full Code Here

    }
   
    @Test
    public void testCounterLevel() throws Exception {
        final String name = "MyCounter";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        // Register a counter to be updated only at the max level
        final ProfileCounter counter =
                cons1.createCounter(name, testType, ProfileLevel.MAX);
       
        // Because the listener is running in a different thread, JUnit
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.