Package com.sun.sgs.profile

Examples of com.sun.sgs.profile.ProfileCollector


                                  ProfileLevel.MIN);
    }
   
    @Test
    public void testOperationName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileConsumer cons2 = collector.getConsumer("c2");
        String name = "myOperation";
        {
            ProfileOperation op1 =
                cons1.createOperation(name,
                                      ProfileDataType.TASK, ProfileLevel.MAX);
View Full Code Here


    }
   
    @Test
    public void testOperationTwice() throws Exception {
        final String name = "myOperation";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileOperation op1 =
                cons1.createOperation(name,
                                      ProfileDataType.TASK, ProfileLevel.MAX);

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

    }
   

    @Test
    public void testOperationType() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileOperation op1 =
            cons1.createOperation("op1", ProfileDataType.TASK,
                                  ProfileLevel.MAX);
        assertTrue(op1 instanceof TaskProfileOperation);
        assertFalse(op1 instanceof AggregateProfileOperation);
View Full Code Here

       
    @Test
    public void testTaskAggregateOperationUnique() throws Exception {
        final String opName = "something";
        final String op1Name = "else";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        final ProfileOperation op =
                cons1.createOperation(opName,
                                      ProfileDataType.TASK_AND_AGGREGATE,
                                      ProfileLevel.MIN);
        final ProfileOperation op1 =
View Full Code Here

    }
   
    /* -- Sample tests -- */
    @Test(expected=NullPointerException.class)
    public void testSampleTaskBadName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileSample s1 =
            cons1.createSample(null, ProfileDataType.TASK, ProfileLevel.MIN);
    }
View Full Code Here

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

            cons1.createSample(null,
                               ProfileDataType.AGGREGATE, ProfileLevel.MIN);
    }
    @Test(expected=NullPointerException.class)
    public void testSampleTaskAggregateBadName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileSample s1 =
            cons1.createSample(null,
                               ProfileDataType.TASK_AND_AGGREGATE,
                               ProfileLevel.MIN);
    }
View Full Code Here

                               ProfileDataType.TASK_AND_AGGREGATE,
                               ProfileLevel.MIN);
    }
    @Test(expected=IllegalArgumentException.class)
    public void testSampleTaskAggregateNegCapacity() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        AggregateProfileSample s1 = (AggregateProfileSample)
            cons1.createSample("foo",
                               ProfileDataType.TASK_AND_AGGREGATE,
                               ProfileLevel.MIN);
        s1.setCapacity(-1);
View Full Code Here

        s1.setCapacity(-1);
    }
   
    @Test
    public void testSampleName() throws Exception {
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileConsumer cons2 = collector.getConsumer("c2");
        String name = "mySample";
        {
            ProfileSample samp1 =
                cons1.createSample(name, ProfileDataType.TASK,
                                   ProfileLevel.MAX);
View Full Code Here

    }
   
    @Test
    public void testSampleTwice() throws Exception {
        final String name = "mySamples";
        ProfileCollector collector = getCollector(serverNode);
        ProfileConsumer cons1 = collector.getConsumer("c1");
        ProfileSample s1 =
                cons1.createSample(name, ProfileDataType.TASK,
                                   ProfileLevel.MAX);

        // Try creating with same name and parameters
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.