2 Replies Latest reply on Jun 26, 2006 2:06 PM by nickman

    Production Profiler Update

      I have tried to integrate the collection and submission of the measurements, allowing for remote submission as well.
      This allows some more flexibility in collecting stats from arbitrary JDBC applications and centralizing them in one location.
      For example, I may want to create a cluster of JMeter JDBC/Database stress testing apps that all send their profiling stats back to a centralized aggregator.

      On the collectors, I need to figure out how to integrate with the ThreadController.
      The premise of the OperationMetricCollector is this:

      The OperationMetricCollectorFactory (factory) creates a new OperationMetricCollector (collector) directly before an operation executes.
      The collector is initialized with all the starting values of the default metrics (elapsed time, cpu time, waits etc.)
      The operation is invoked.
      The factory then:
      Closes the collector, re-measuring the default metrics and calculating the delta.
      Submits the collector, delivering it (remotely or locally) to the aggregating MBean?s thread pool queue.
      Before the collection is closed, it is possible to add additional arbitrary stats to the collection.


      Accordingly, if we are to implement this in conjunction with the ThreadController, (and taking from your EJBContainerInterceptor code), it would look somethign like this:





      OperationMetricCollector collector = operationMetricCollectorFactory.newCollector(category, metricName);
      ThreadController.pushMeasure(collection);
      Object returnValue = super.invokeHome(mi);
      ThreadController.popMeasure(); // popMeasure can close and submit the collection.
      


      or, if we hide the collector and the factory behind the the ThreadController completely, then it could look like this:

      ThreadController.pushMeasure(opCategory, opName);
      Object returnValue = super.invokeHome(mi);
      ThreadController.popMeasure(opCategory, opName);
      


      Does that align with what you were thinking ?
      Can you elaborate on how we will track the graph using the ThreadController ?

      Thanks.

      //Nicholas

        • 1. Re: Production Profiler Update
          clebert.suconic

          Yes... that aligns to what I was thinking.

          I like the idea on hide the collector inside the ThreadController. (I'm not sure if we will still need Factories)

          So, we will use something like:

          ThreadController.pushMeasure(opCategory, opName);
          Object returnValue = super.invokeHome(mi);
          ThreadController.popMeasure(opCategory, opName);
          


          At this point we don't have the category. But that's something we should add.

          • 2. Re: Production Profiler Update

            Looks good.

            So in BasicController, we can implement something like this:

            public static void pushMeasure(String category, String nodeName) {
             OperationMetricCollector collector = factory.newCollector(category, nodeName);
             getController().pushMeasure(collector);
            }
            
            
            public static void popMeasure(String category, String nodeName) {
             OperationMetricCollector collector = getController().popMeasure();
             factory.closeCollectorAndSubmit(collector);
            }
            
            public static void popFailure(String category, String nodeName) {
             OperationMetricCollector collector = getController().popMeasure();
             collector.setLocalStat("Failures", 1L); // Allows us to aggregate failures on this operation
             factory.closeCollectorAndSubmit(collector);
            }