Skip to content

Commit

Permalink
Minor cleanup in measurements
Browse files Browse the repository at this point in the history
  • Loading branch information
easbar committed Nov 13, 2019
1 parent 556f3c8 commit 5f18863
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ run_measurement:
- export BENCHMARK_BIG_MAP_NAME=germany-190101.osm.pbf
- export BENCHMARK_SMALL_MAP_URL=http://download.geofabrik.de/europe/germany/${BENCHMARK_SMALL_MAP_NAME}
- export BENCHMARK_BIG_MAP_URL=http://download.geofabrik.de/europe/${BENCHMARK_BIG_MAP_NAME}
- mkdir -p ${BENCHMARK_DIR}osm
- export BENCHMARK_SMALL_MAP_PATH=${BENCHMARK_DIR}osm/${BENCHMARK_SMALL_MAP_NAME}
- export BENCHMARK_BIG_MAP_PATH=${BENCHMARK_DIR}osm/${BENCHMARK_BIG_MAP_NAME}
- mkdir -p ${BENCHMARK_DIR}osm
- mvn $MAVEN_CLI_OPTS package -DskipTests -pl tools -am
- chmod +x -R benchmark
- benchmark/download_map.sh $BENCHMARK_SMALL_MAP_URL $BENCHMARK_SMALL_MAP_PATH
Expand Down
4 changes: 2 additions & 2 deletions benchmark/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# benchmark/benchmark.sh <data_dir> <results_dir> <small_osm_map_path> <big_osm_map_path>
#
# where:
# <data_dir> = directory used to download map and store results
# <results_dir> = name of directory where results of this run are stored
# <data_dir> = base directory used to store results
# <results_dir> = name of directory where results of this run are stored (inside <data_dir>)
# <small_osm_map_path> = path to osm map the measurement is run on for slow measurements
# <big_osm_map_path> = path to osm map the measurement is run on for fast measurements

Expand Down
14 changes: 7 additions & 7 deletions tools/src/main/java/com/graphhopper/tools/Measurement.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,13 @@ protected DataReader importData() throws IOException {
put("measurement.totalMB", getTotalMB());
put("measurement.usedMB", getUsedMB());

if (!summaryLocation.trim().isEmpty()) {
if (!isEmpty(summaryLocation)) {
writeSummary(summaryLocation, propLocation);
}
if (useJson) {
storeJson(graphLocation, propLocation);
storeJson(propLocation);
} else {
storeProperties(graphLocation, propLocation);
storeProperties(propLocation);
}
}
}
Expand Down Expand Up @@ -595,7 +595,7 @@ void put(String key, Object val) {
properties.put(key, val);
}

private void storeJson(String graphLocation, String jsonLocation) {
private void storeJson(String jsonLocation) {
logger.info("storing measurement json in " + jsonLocation);
Map<String, Object> result = new HashMap<>();
Map<String, String> gitInfoMap = new HashMap<>();
Expand All @@ -615,11 +615,11 @@ private void storeJson(String graphLocation, String jsonLocation) {
.writerWithDefaultPrettyPrinter()
.writeValue(file, result);
} catch (IOException e) {
logger.error("Problem while storing json " + graphLocation + ", " + jsonLocation, e);
logger.error("Problem while storing json in: " + jsonLocation, e);
}
}

private void storeProperties(String graphLocation, String propLocation) {
private void storeProperties(String propLocation) {
logger.info("storing measurement properties in " + propLocation);
try (FileWriter fileWriter = new FileWriter(propLocation)) {
String comment = "measurement finish, " + new Date().toString() + ", " + Constants.BUILD_DATE;
Expand All @@ -632,7 +632,7 @@ private void storeProperties(String graphLocation, String propLocation) {
}
fileWriter.flush();
} catch (IOException e) {
logger.error("Problem while storing properties " + graphLocation + ", " + propLocation, e);
logger.error("Problem while storing properties in: " + propLocation, e);
}
}

Expand Down

0 comments on commit 5f18863

Please sign in to comment.