Package org.jboss.profiler.aop.monitoring.model

Examples of org.jboss.profiler.aop.monitoring.model.MonitoringMeasure


        clear();
        MonitoringController.grade = grade;
    }

    public static void openStack(String aggregation, String measure, long eventTime) {
        MonitoringMeasure monitoringMeasure = findMeasure(aggregation, measure);
        TimeValue value = findTimeValue(monitoringMeasure, eventTime);
        value.openStack();
        monitoringMeasure.getRootValue().openStack();
    }
View Full Code Here


        return aggregation;
    }

    public static void closeStack(String aggregation, String measure, long eventTime,long time, long cpuTime) {
        MonitoringMeasure monitoringMeasure = findMeasure(aggregation, measure);
        TimeValue value = findTimeValue(monitoringMeasure, eventTime);
        value.closeStack(time,cpuTime);
        monitoringMeasure.getRootValue().closeStack(time,cpuTime);
    }
View Full Code Here

        return (MonitoringMeasure)measuresMap.get(measure);
    }

    /** Finds the measure and creates it if not found */
    protected static MonitoringMeasure findMeasure(String aggregation, String measure) {
        MonitoringMeasure monitoringMeasure = (MonitoringMeasure)measuresMap.get(measure);
        if (monitoringMeasure==null) {
            synchronized (measuresMap) {
                monitoringMeasure = (MonitoringMeasure)measuresMap.get(measure);
                if (monitoringMeasure==null) {
                  monitoringMeasure = new MonitoringMeasure(measure);
                  measuresMap.put(measure,monitoringMeasure);
                  MeasureAggregation aggregationObject = findAggregation(aggregation);
                  aggregationObject.setMeasure(measure,monitoringMeasure);
                }
            }
View Full Code Here

            MonitoringController.openStack("Test2","Test2", time);

            MonitoringController.closeStack("Test2","Test2", time, 0, 0);
        }

        MonitoringMeasure measure = MonitoringController.findMeasureByName("Test");
        assertEquals(1, measure.getValues().size());

        TimeValue value = (TimeValue) measure.getValues().values().toArray()[0];
        assertEquals(1000, value.getCallings());
        assertEquals (2,MonitoringController.getAggregationsSet().size());

        MeasureAggregation aggregation = MonitoringController.findAggregation("Test");
        if (aggregation!=null) {
          Iterator measures = aggregation.getMeasureSet().iterator();

          while (measures.hasNext()) {
              measure = (MonitoringMeasure)measures.next();
              TimeValue rootValue = measure.getRootValue();
          }
        }

    }
View Full Code Here

                e.printStackTrace();
            }
        }


        MonitoringMeasure measure = MonitoringController.findMeasureByName("Test");
        assertEquals(1, measure.getValues().size());

        TimeValue value = (TimeValue) measure.getValues().values().toArray()[0];
        assertEquals(15000, value.getCallings());
        assertEquals (1,MonitoringController.getAggregationsSet().size());


    }
View Full Code Here

            MeasureAggregation aggregation = (MeasureAggregation) aggregations.next();
            System.out.println("_____________________________________________________");
            System.out.println("Aggregation=" + aggregation.getName());
            Iterator measures = aggregation.getMeasureSet().iterator();
            while (measures.hasNext()) {
                MonitoringMeasure measure = (MonitoringMeasure)measures.next();
                System.out.print("Measure=" + measure.getName() + " callings="+ measure.getRootValue().getCallings() + " Time elements=" + measure.getValues().size());
                if (measure.getRootValue().getCallings()!=0) {
                    System.out.println(" avg time=" + (measure.getRootValue().getTotalTime()/measure.getRootValue().getCallings()));
                } else {
                    System.out.println();
                }
            }
        }
View Full Code Here

            return MonitoringController.findMeasureByName(currentMeasure);
        }
    }

    private TimeValue getMeasureCurrentGrade() {
        MonitoringMeasure measure = getMeasure();
        if (measure!=null) {
            return MonitoringController.findCurrentTimeValue(measure);
        } else {
            return null;
        }
View Full Code Here

    /* (non-Javadoc)
     * @see org.jboss.profiler.AOPStatisticsMonitoringServiceMBean#getAvgTime()
     */
    public long getAvgTime() {
        MonitoringMeasure measure = getMeasure();
        if (measure==null) {
            return 0l;
        } else {
            return measure.getRootValue().getAvgTime();
        }
    }
View Full Code Here

    }
    /* (non-Javadoc)
     * @see org.jboss.profiler.AOPStatisticsMonitoringServiceMBean#getRequests()
     */
    public long getCallings() {
        MonitoringMeasure measure = getMeasure();
        if (measure==null) {
            return 0l;
        } else {
            return measure.getRootValue().getCallings();
        }
    }
View Full Code Here

    }
    /* (non-Javadoc)
     * @see org.jboss.profiler.AOPStatisticsMonitoringServiceMBean#maxThreads()
     */
    public long getMaxThreads() {
        MonitoringMeasure measure = getMeasure();
        if (measure==null) {
            return 0;
        } else {
            return measure.getRootValue().getMaxStack();
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.profiler.aop.monitoring.model.MonitoringMeasure

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.