MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / readMap

Method readMap

test/test/alloc/MapReader.java:40–53  ·  view source on GitHub ↗
(InputStream in)

Source from the content-addressed store, hash-verified

38 }
39
40 public Map<String, Long> readMap(InputStream in) throws IOException {
41 Map<String, Long> map = new HashMap<>();
42
43 try (BufferedReader br = new BufferedReader(new InputStreamReader(in))) {
44 for (String line; (line = br.readLine()) != null; ) {
45 String[] kv = line.split(":", 2);
46 String key = kv[0].trim();
47 String value = kv[1].trim();
48 map.put(key, Long.parseLong(value));
49 }
50 }
51
52 return map;
53 }
54
55 public void benchmark() throws IOException {
56 while (true) {

Callers 1

benchmarkMethod · 0.95

Calls 2

trimMethod · 0.80
putMethod · 0.45

Tested by

no test coverage detected