Examples of Measurements


Examples of avrora.util.profiling.Measurements

     */
    public GraphNumbers(JPanel parent) {

        parentPanel = parent;

        publicNumbers = new Measurements();
        privateNumbers = new Measurements();

        //Set option defaults
        lineColor = Color.GREEN; //default line color is green
        backColor = Color.BLACK; //default background color is black
        cursorColor = Color.CYAN;
View Full Code Here

Examples of avrora.util.profiling.Measurements

     * to update the privateNumbers vector
     * returns true if it actually got some numbers, otherwise returns false
     * It might also be called by paint thread
     */
    public boolean internalUpdate() {
        Measurements newNumbers = publicNumbers;
        synchronized ( this ) {
            if ( newNumbers.size() == 0 ) {
                return false;
            }
            publicNumbers = new Measurements();
        }

        // add all the new numbers
        privateNumbers.addAll(newNumbers);
        int max = privateNumbers.max();
View Full Code Here

Examples of com.yahoo.ycsb.measurements.Measurements

     */
    public void cleanup() throws DBException
    {
        // Get the measurements instance as this is the only client that should
        // count clean up time like an update since autoflush is off.
        Measurements _measurements = Measurements.getMeasurements();
        try {
            long st=System.nanoTime();
            if (_hTable != null) {
                _hTable.flushCommits();
            }
            long en=System.nanoTime();
            _measurements.measure("UPDATE", (int)((en-st)/1000));
        } catch (IOException e) {
            throw new DBException(e);
        }
    }
View Full Code Here

Examples of eu.planets_project.pp.plato.model.measurement.Measurements

     * uses its property name as key for this hashmap
     *  
     * @param m
     */
    public void addMeasurement(Measurement m) {
        Measurements ms = measurements.get(m.getProperty().getName());
        if (ms == null) {
            ms = new Measurements();
            measurements.put(m.getProperty().getName(), ms);
        }
        ms.addMeasurement(m);
    }
View Full Code Here

Examples of eu.planets_project.pp.plato.model.measurement.Measurements

     *
     * @param propertyName
     * @return
     */
    public Measurement getAverage(String propertyName) {
        Measurements m = measurements.get(propertyName);
        return (m == null ? null : m.getAverage());
    }
View Full Code Here

Examples of eu.planets_project.pp.plato.model.measurement.Measurements

     *
     * @param propertyName
     * @return
     */
    public int getSize(String propertyName) {
        Measurements m = measurements.get(propertyName);
        return (m == null ? 0 : m.getSize());
    }
View Full Code Here

Examples of eu.planets_project.pp.plato.model.measurement.Measurements

     * time and size of the file that has been migrated.
     *
     * @return startup time of the tool
     */
    public double getStartupTime() {
        Measurements elapsedTimeMeasurements = measurements.get(MigrationResult.MIGRES_USED_TIME);
        Measurements resultFileSizes = measurements.get(MigrationResult.MIGRES_RESULT_FILESIZE);
        Measurements relativeFileSizes = measurements.get(MigrationResult.MIGRES_RELATIVE_FILESIZE);
       
        if (elapsedTimeMeasurements == null || resultFileSizes == null || relativeFileSizes == null) {
            return 0.0;
        }
               
        if (!((elapsedTimeMeasurements.getSize() == resultFileSizes.getSize())
                && (resultFileSizes.getSize() == relativeFileSizes.getSize()))) {
            return 0.0;
        }

        // For some reason the library cannot calculate the function if it has only 2 values.
        // IllegalArgumentException: The degrees of freedom must be greater than 0
        //  is the result.
        if (elapsedTimeMeasurements.getSize() <= 2) {
            return 0.0;
        }
       
        if (elapsedTimeMeasurements.getSize() <= 0) {
            return 0.0;
        }
       
        double[] xArray = new double[elapsedTimeMeasurements.getSize()];
        double[] yArray = new double[elapsedTimeMeasurements.getSize()];
       
        int i = 0;
       
        for (i = 0; i < resultFileSizes.getSize(); i++) {
           
            double resultFileSize = ((INumericValue)resultFileSizes.getList().get(i).getValue()).value();
            double factor = ((INumericValue)relativeFileSizes.getList().get(i).getValue()).value();
           
            xArray[i] = (resultFileSize / factor) * 100.0;
            yArray[i] = ((INumericValue)elapsedTimeMeasurements.getList().get(i).getValue()).value();
        }
       
View Full Code Here

Examples of eu.planets_project.pp.plato.model.measurement.Measurements

                    pcrFile = makePCR(time);
                    cprFile = compare(inXCDL,outXCDL,pcrFile,wDir);  
   
                    if (!"".equals(cprFile)) {
                        // digest output (cf. plato integration)
                        Measurements measurements =
                            extractMeasurements(cprFile, getMeasurableProperties());
                        // write stats (only stats for the moment) to MigrationResult
                        for (Measurement m : measurements.getList()) {
                            list.add(m);
                        }
                    }
                }
            } catch (Exception e) {
View Full Code Here

Examples of eu.planets_project.pp.plato.model.measurement.Measurements

            new File(cprFile).delete();
        }
    }

    private Measurements extractMeasurements(String cprFile, List<MeasurableProperty> properties) {
        Measurements result = new Measurements();
        try {
            ComparatorUtils compUtils = new ComparatorUtils();
            List<CompareResult> compResult = compUtils.parseResponse(cprFile);
            if (compResult.size() == 1) {
                /* we compare two xcdl files, which correspond to one compSet */
                for(MeasurableProperty p : properties) {
                    /*
                     * get all values for measureable properties that correspond to xcl properties:
                     * they have the pattern: xcl:<propertyName>:<metricName>
                     */
                    String[] keyParts =  p.getName().split(":");
                    if (keyParts.length == 3) {
                        if ("xcl".equals(keyParts[0])) {
                            CprProperty cprP =
                               compResult.get(0).getProperties().get(keyParts[1]);
                            if (cprP != null) {
                                String id = MetricToScaleMapping.getMetricId(keyParts[2]);
                                if (id != null) {
                                    Value v = null;                                   
                                    Scale s = MetricToScaleMapping.getScale(id);
                                    if (s == null) {
                                        // There is a new XCLMetric we have not registered in MetricToScaleMapping yet...
                                        log.debug("CPR: unkown metricId: " +  id);
                                    } else {
                                        // scale found, so we can create a value object
                                        v =  s.createValue();
                                        v.setScale(null);
                                       
                                        CprMetricResult mResult = cprP.getResultMetrics().get(id);
                                        if (mResult != null) {
                                            if ("ok".equals(mResult.getState())) {
                                                v.parse(mResult.getResult());
                                                v.setComment("xcdl values(sample::result)=(" + cprP.getSource()+"::" + cprP.getTarget()+")");
                                            } else {
                                                v.setComment(mResult.getResult());
                                            }
                                        }                                       
                                    }
                                    if (v != null) {
                                        Measurement m = new Measurement();
                                        m.setProperty(p);
                                        // TODO: validate type of value with respect to property(scale)
                                        m.setValue(v);
                                        result.addMeasurement(m);
                                    }
                                }
                            }
                        }
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.