Package com.sun.sgs.profile

Examples of com.sun.sgs.profile.ProfileConsumer


    final ProfileOperation isLocalNodeAliveNonTransOp;
   
    WatchdogServiceStats(ProfileCollector collector, WatchdogServiceImpl wdog) {
        watchdog = wdog;
       
        ProfileConsumer consumer =
            collector.getConsumer(ProfileCollectorImpl.CORE_CONSUMER_PREFIX +
                                  "WatchdogService");
        ProfileLevel level = ProfileLevel.MAX;
        ProfileDataType type = ProfileDataType.TASK_AND_AGGREGATE;
       
        addNodeListenerOp =
            consumer.createOperation("addNodeListener", type, level);
        addRecoveryListenerOp =
            consumer.createOperation("addRecoveryListener", type, level);
        getBackupOp =
            consumer.createOperation("getBackup", type, level);
        getLocalNodeIdOp =
            consumer.createOperation("getLocalNodeId", type, level);
        getNodeOp =
            consumer.createOperation("getNode", type, level);
        getNodesOp =
            consumer.createOperation("getNodes", type, level);
        isLocalNodeAliveOp =
            consumer.createOperation("isLocalNodeAlive", type, level);
        isLocalNodeAliveNonTransOp =
            consumer.createOperation("isLocalNodeAliveNonTransactional",
                                     type, level);
    }
View Full Code Here


        // 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;
            }
        }
       
        // Schedule a periodic task to print reports
View Full Code Here

     * Create a data store statistics object.
     * @param collector the profile collector used to create profiling
     *     objects and register the MBean with JMX
     */
    DataStoreStats(ProfileCollector collector) {
        ProfileConsumer consumer =
            collector.getConsumer(ProfileCollectorImpl.CORE_CONSUMER_PREFIX
                                  + "DataStore");
        ProfileLevel level = ProfileLevel.MAX;
        ProfileDataType type = ProfileDataType.TASK_AND_AGGREGATE;
       
  createObjectOp =
            consumer.createOperation("createObject", type, level);
  markForUpdateOp =
            consumer.createOperation("markForUpdate", type, level);
  getObjectOp = consumer.createOperation("getObject", type, level);
  getObjectForUpdateOp =
      consumer.createOperation("getObjectForUpdate", type, level);
  setObjectOp = consumer.createOperation("setObject", type, level);
  setObjectsOp = consumer.createOperation("setObjects", type, level);
  removeObjectOp =
            consumer.createOperation("removeObject", type, level);
  getBindingOp = consumer.createOperation("getBinding", type, level);
  setBindingOp = consumer.createOperation("setBinding", type, level);
  removeBindingOp =
            consumer.createOperation("removeBinding", type, level);
  nextBoundNameOp =
            consumer.createOperation("nextBoundName", type, level);
  getClassIdOp = consumer.createOperation("getClassId", type, level);
  getClassInfoOp =
            consumer.createOperation("getClassInfo", type, level);
  nextObjectIdOp =
            consumer.createOperation("nextObjectIdOp", type, level);
       
        // Counters
  readBytesCounter = consumer.createCounter("readBytes", type, level);
  readObjectsCounter =
      consumer.createCounter("readObjects", type, level);
  writtenBytesCounter =
      consumer.createCounter("writtenBytes", type, level);
  writtenObjectsCounter =
      consumer.createCounter("writtenObjects", type, level);
       
        // Samples
  readBytesSample =
            consumer.createSample("readBytes", type, level);
  writtenBytesSample =
            consumer.createSample("writtenBytes", type, level);
    }
View Full Code Here

    final ProfileOperation scheduleTaskOp;
    final ProfileOperation scheduleTaskDelayedOp;
    final ProfileOperation scheduleTaskPeriodicOp;
   
    TaskServiceStats(ProfileCollector collector) {
        ProfileConsumer consumer =
            collector.getConsumer(ProfileCollectorImpl.CORE_CONSUMER_PREFIX +
                                  "TaskService");
        ProfileLevel level = ProfileLevel.MAX;
        ProfileDataType type = ProfileDataType.TASK_AND_AGGREGATE;
       
        scheduleNDTaskOp =
            consumer.createOperation("scheduleNonDurableTask", type, level);
        scheduleNDTaskDelayedOp =
            consumer.createOperation("scheduleNonDurableTaskDelayed",
                                       type, level);
        scheduleTaskOp =
            consumer.createOperation("scheduleTask", type, level);
        scheduleTaskDelayedOp =
            consumer.createOperation("scheduleDelayedTask", type, level);
        scheduleTaskPeriodicOp =
            consumer.createOperation("schedulePeriodicTask", type, level);
    }
View Full Code Here

    final ProfileOperation registerSessionDisconnectListenerOp;
    final ProfileOperation getSessionProtocolOp;
   
    ClientSessionServiceStats(ProfileCollector collector) {
        ProfileConsumer consumer =
            collector.getConsumer(ProfileCollectorImpl.CORE_CONSUMER_PREFIX +
                                  "ClientSessionService");
        ProfileLevel level = ProfileLevel.MAX;
        ProfileDataType type = ProfileDataType.TASK_AND_AGGREGATE;
       
        registerSessionDisconnectListenerOp =
            consumer.createOperation("registerSessionDisconnectListener",
                                     type, level);
        getSessionProtocolOp =
            consumer.createOperation("getSessionProtocol", type, level);
    }
View Full Code Here

        return keys.toArray(new String[keys.size()]);
    }

    /** {@inheritDoc} */
    public ProfileLevel getConsumerLevel(String consumer) {
        ProfileConsumer cons = collector.getConsumers().get(consumer);
        if (cons == null) {
            throw new IllegalArgumentException(
                    "no consumer found named " + consumer);
        }
       
        return cons.getProfileLevel();
    }
View Full Code Here

        return cons.getProfileLevel();
    }

    /** {@inheritDoc} */
    public void setConsumerLevel(String consumer, ProfileLevel level) {
        ProfileConsumer cons = collector.getConsumers().get(consumer);
        if (cons == null) {
            throw new IllegalArgumentException(
                    "no consumer found named " + consumer);
        }
        cons.setProfileLevel(level);
    }
View Full Code Here

     *              object
     */
    TaskAggregateStats(ProfileCollector collector, String name) {
        super(notificationInfo);
        this.collector = collector;
        ProfileConsumer consumer = collector.getConsumer(name);
       
        // We could determine that some of these statistics need to be
        // on all the time (level MIN) so we can use them for load balancing
        // or because they are extremely useful.
        //
        // Note that if the counters are all on the time, we could just
        // as easily use AtomicLongs rather than AggregateProfileCounters.
        ProfileLevel level = ProfileLevel.MEDIUM;
       
        // These statistics are reported to the profile reports
        // directly, with the ProfileCollector.
        // They should not be reported as TASK_AND_AGGREGATE because,
        // for nested tasks, we don't want to merge their values into
        // the parent's value.
        ProfileDataType type = ProfileDataType.AGGREGATE;
       
        numTasks = (AggregateProfileCounter)
                consumer.createCounter("numTasks", type, level);
        numTransactionalTasks = (AggregateProfileCounter)
                consumer.createCounter("numTransactionalTasks", type, level);
        numFailedTasks = (AggregateProfileCounter)
                consumer.createCounter("numFailedTasks", type, level);
        readyCount = (AggregateProfileSample)
                consumer.createSample("readyCount", type, level);
        runtime = (AggregateProfileSample)
                consumer.createSample("runtime", type, level);
        lagtime = (AggregateProfileSample)
                consumer.createSample("lagTime", type, level);
        latency = (AggregateProfileSample)
                consumer.createSample("latency", type, level);
        setSmoothing(smoothingFactor);
    }
View Full Code Here

    final ProfileOperation createChannelOp;
    final ProfileOperation getChannelOp;
   
    ChannelServiceStats(ProfileCollector collector) {
        ProfileConsumer consumer =
            collector.getConsumer(ProfileCollectorImpl.CORE_CONSUMER_PREFIX +
                                  "ChannelService");
        ProfileLevel level = ProfileLevel.MAX;
        ProfileDataType type = ProfileDataType.TASK_AND_AGGREGATE;
       
        // Manager operations
        createChannelOp =
            consumer.createOperation("createChannel", type, level);
        getChannelOp =
            consumer.createOperation("getChannel", type, level);
    }
View Full Code Here

    final ProfileOperation getIdentitiesOp;
    final ProfileOperation getNodeOp;
    final ProfileOperation setStatusOp;
   
    NodeMappingServiceStats(ProfileCollector collector) {
        ProfileConsumer consumer =
            collector.getConsumer(ProfileCollectorImpl.CORE_CONSUMER_PREFIX +
                                  "NodeMappingService");

        ProfileLevel level = ProfileLevel.MAX;
        ProfileDataType type = ProfileDataType.TASK_AND_AGGREGATE;

        addNodeMappingListenerOp = (AggregateProfileOperation)
            consumer.createOperation("addNodeMappingListener", type, level);
        assignNodeOp =
            consumer.createOperation("assignNode", type, level);
        getIdentitiesOp =
            consumer.createOperation("getIdentities", type, level);
        getNodeOp =
            consumer.createOperation("getNode", type, level);
        setStatusOp =
            consumer.createOperation("setStatus", type, level);
    }
View Full Code Here

TOP

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

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.