(filename)
| 172 | # ... |
| 173 | # ] |
| 174 | def __parse_java_result(filename): |
| 175 | if filename == "": |
| 176 | return |
| 177 | if filename[0] != '/': |
| 178 | filename = os.path.dirname(os.path.abspath(__file__)) + '/' + filename |
| 179 | with open(filename, "rb") as f: |
| 180 | results = json.loads(f.read()) |
| 181 | for result in results: |
| 182 | total_weight = 0 |
| 183 | total_value = 0 |
| 184 | for measurement in result["measurements"]: |
| 185 | total_weight += measurement["weight"] |
| 186 | total_value += measurement["value"]["magnitude"] |
| 187 | avg_time = total_value * 1.0 / total_weight |
| 188 | total_size, _ = __get_data_size( |
| 189 | result["scenario"]["benchmarkSpec"]["parameters"]["dataFile"]) |
| 190 | __results.append({ |
| 191 | "language": "java", |
| 192 | "throughput": total_size / avg_time * 1e9 / 2 ** 20, |
| 193 | "behavior": result["scenario"]["benchmarkSpec"]["methodName"], |
| 194 | "dataFilename": __extract_file_name( |
| 195 | result["scenario"]["benchmarkSpec"]["parameters"]["dataFile"]) |
| 196 | }) |
| 197 | |
| 198 | |
| 199 | # Go benchmark results: |
no test coverage detected