Package com.sun.sgs.profile

Examples of com.sun.sgs.profile.ProfileCollector


                                ProfileLevel.MIN);
    }
   
    @Test
    public void testCounterName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileConsumer cons2 = collector.getConsumer("c2");
        String name = "taskcounter";
        {
            ProfileCounter counter1 =
                    cons1.createCounter(name,
                                        ProfileDataType.TASK, ProfileLevel.MAX);
View Full Code Here


    }
   
    @Test
    public void testCounterTwice() throws Exception {
        final String name = "counter";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileCounter counter1 =
                cons1.createCounter(name,
                                    ProfileDataType.TASK, ProfileLevel.MAX);

        // Try creating with same name and parameters
View Full Code Here

        assertNotSame(counter1, counter4);
    }
   
    @Test
    public void testCounterType() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileCounter counter =
                cons1.createCounter("counter",
                                    ProfileDataType.TASK, ProfileLevel.MIN);
        assertTrue(counter instanceof TaskProfileCounter);
        assertFalse(counter instanceof AggregateProfileCounter);
View Full Code Here

       
    }

    @Test(expected=IllegalStateException.class)
    public void testTaskCounterIncrementNoTransaction() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        final ProfileCounter counter =
                cons1.createCounter("my counter",
                                    ProfileDataType.TASK, ProfileLevel.MIN);
       
        counter.incrementCount();
View Full Code Here

        counter.incrementCount();
    }
   
    @Test(expected=IllegalStateException.class)
    public void testTaskCounterIncrementValueNoTransaction() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        final ProfileCounter counter =
                cons1.createCounter("my counter",
                                    ProfileDataType.TASK, ProfileLevel.MIN);
       
        counter.incrementCount(55);
View Full Code Here

    }
   
    @Test
    public void testAggregateProfileCounterNotInTaskReport() 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,
                                        ProfileDataType.AGGREGATE,
View Full Code Here

    }
   
    @Test
    public void testTaskAggregateProfileCounter() 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,
                                        ProfileDataType.TASK_AND_AGGREGATE,
View Full Code Here

   
   
    /* -- Operation tests -- */
    @Test(expected=NullPointerException.class)
    public void testOperationTaskBadName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileOperation o1 =
            cons1.createOperation(null, ProfileDataType.TASK, ProfileLevel.MIN);
    }
View Full Code Here

        ProfileOperation o1 =
            cons1.createOperation(null, ProfileDataType.TASK, ProfileLevel.MIN);
    }
    @Test(expected=NullPointerException.class)
    public void testOperationAggregateBadName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileOperation o1 =
            cons1.createOperation(null,
                                  ProfileDataType.AGGREGATE, ProfileLevel.MIN);
    }
View Full Code Here

            cons1.createOperation(null,
                                  ProfileDataType.AGGREGATE, ProfileLevel.MIN);
    }
    @Test(expected=NullPointerException.class)
    public void testOperationTaskAggregateBadName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileOperation o1 =
            cons1.createOperation(null,
                                  ProfileDataType.TASK_AND_AGGREGATE,
                                  ProfileLevel.MIN);
    }
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.