Changeset 9771 in josm for trunk/test/performance/org/openstreetmap
- Timestamp:
- 2016-02-09T18:58:37+01:00 (9 years ago)
- Location:
- trunk/test/performance/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/performance/org/openstreetmap/josm/PerformanceTestUtils.java
r9205 r9771 16 16 private String name; 17 17 private long time; 18 private boolean measurementPlotsPlugin = false; 18 19 19 20 protected PerformanceTestTimer(String name) { … … 23 24 24 25 /** 26 * Activate output for the Jenkins Measurement Plots Plugin. 27 * @param active true if it should be activated 28 */ 29 public void setMeasurementPlotsPluginOutput(boolean active) { 30 measurementPlotsPlugin = active; 31 } 32 /** 25 33 * Prints the time since this timer was created. 26 34 */ 27 35 public void done() { 28 long dTime = System.nanoTime() - time; 29 System.out.println("TIMER " + name + ": " + dTime / 1000000 + "ms"); 36 long dTime = (System.nanoTime() - time) / 1000000; 37 if (measurementPlotsPlugin) { 38 System.out.println(String.format("<measurement><name>%s (ms)</name><value>%.1f</value></measurement>", name, (double)dTime)); 39 } else { 40 System.out.println("TIMER " + name + ": " + dTime + "ms"); 41 } 30 42 } 31 43 } -
trunk/test/performance/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSourceFilterTest.java
r9458 r9771 101 101 data.generateDataSet(); 102 102 CssGenerator css = new CssGenerator(data).addKeyValueRules(TEST_RULE_COUNT); 103 runTest(data, css, "only key=value rules" );103 runTest(data, css, "only key=value rules", false); 104 104 } 105 105 … … 112 112 data.generateDataSet(); 113 113 CssGenerator css = new CssGenerator(data).addHasKeyRules(TEST_RULE_COUNT); 114 runTest(data, css, "only has key rules" );114 runTest(data, css, "only has key rules", false); 115 115 } 116 116 … … 123 123 data.generateDataSet(); 124 124 CssGenerator css = new CssGenerator(data).addKeyRegexpRules(TEST_RULE_COUNT); 125 runTest(data, css, "regular expressions" );125 runTest(data, css, "regular expressions", true); 126 126 } 127 127 … … 134 134 data.generateDataSet(); 135 135 CssGenerator css = new CssGenerator(data).addIsTrueRules(TEST_RULE_COUNT); 136 runTest(data, css, "is true" );136 runTest(data, css, "is true", false); 137 137 } 138 138 139 private void runTest(KeyValueDataGenerator data, CssGenerator css, String description ) {139 private void runTest(KeyValueDataGenerator data, CssGenerator css, String description, boolean measurementPlotsPlugin) { 140 140 MapCSSStyleSource source = new MapCSSStyleSource(css.getCss()); 141 141 PerformanceTestTimer timer = PerformanceTestUtils.startTimer("MapCSSStyleSource#loadStyleSource(...) for " + description); … … 143 143 timer.done(); 144 144 145 timer = PerformanceTestUtils.startTimer(APPLY_CALLS + "x MapCSSStyleSource#apply(...) for " + description); 145 if (measurementPlotsPlugin) { 146 timer = PerformanceTestUtils.startTimer(description); 147 timer.setMeasurementPlotsPluginOutput(true); 148 } else { 149 timer = PerformanceTestUtils.startTimer(APPLY_CALLS + "x MapCSSStyleSource#apply(...) for " + description); 150 } 146 151 for (int i = 0; i < APPLY_CALLS; i++) { 147 152 MultiCascade mc = new MultiCascade();
Note:
See TracChangeset
for help on using the changeset viewer.