Ignore:
Timestamp:
2016-02-11T23:37:07+01:00 (8 years ago)
Author:
bastiK
Message:

new mappaint performance test
tests different features separately

Location:
trunk/test/performance/org/openstreetmap/josm
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/performance/org/openstreetmap/josm/PerformanceTestUtils.java

    r9773 r9786  
    33
    44import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     5
     6import org.openstreetmap.josm.io.XmlWriter;
    57
    68/**
     
    1416     */
    1517    public static class PerformanceTestTimer {
    16         private String name;
    17         private long time;
     18        private final String name;
     19        private final long time;
    1820        private boolean measurementPlotsPlugin = false;
    1921
     
    3739            long dTime = (System.nanoTime() - time) / 1000000;
    3840            if (measurementPlotsPlugin) {
    39                 System.out.println(String.format("<measurement><name>%s (ms)</name><value>%.1f</value></measurement>", name, (double) dTime));
     41                measurementPlotsPluginOutput(name + "(ms)", dTime);
    4042            } else {
    4143                System.out.println("TIMER " + name + ": " + dTime + "ms");
     
    5860        return new PerformanceTestTimer(name);
    5961    }
     62
     63    /**
     64     * Emit one data value for the Jenkins Measurement Plots Plugin.
     65     *
     66     * The plugin collects the values over multiple builds and plots them in a diagram.
     67     *
     68     * @see https://wiki.jenkins-ci.org/display/JENKINS/Measurement+Plots+Plugin
     69     * @param name the name / title of the measurement
     70     * @param value the value
     71     */
     72    public static void measurementPlotsPluginOutput(String name, double value) {
     73        System.out.println("<measurement><name>"+XmlWriter.encode(name)+"</name><value>"+value+"</value></measurement>");
     74    }
    6075}
Note: See TracChangeset for help on using the changeset viewer.