MCPcopy Create free account
hub / github.com/defold/defold / dump

Method dump

editor/src/java/com/defold/util/Profiler.java:134–158  ·  view source on GitHub ↗
(String filename)

Source from the content-addressed store, hash-verified

132 }
133
134 public static synchronized void dump(String filename) throws IOException {
135 Collections.sort(samples, new Comparator<Sample>() {
136
137 @Override
138 public int compare(Sample o1, Sample o2) {
139 return Double.compare(o1.start, o2.start);
140 }
141
142 });
143
144 try (PrintStream out = new PrintStream(new FileOutputStream(filename))) {
145 out.println("start,end,name,user1,user2,thread,frame");
146 double min = Double.MAX_VALUE;
147 for (Sample s : samples) {
148 min = Math.min(min, s.start);
149 }
150 for (Sample s : samples) {
151 out.format("%f,%f,%s,%s,%s,%s,%s,%n", s.start - min, s.end - min, s.name, s.user1, s.user2, s.thread, s.frame);
152 }
153 System.out.format("Profile %s written%n", filename);
154 } catch (FileNotFoundException e) {
155 throw new IOException(e);
156 }
157
158 }
159}

Callers 8

runTestSingleFunction · 0.80
export_result_jsonFunction · 0.80
to_jsonFunction · 0.80
to_script_apiFunction · 0.80
generate_jsonFunction · 0.80
save_timesMethod · 0.80

Calls 3

minMethod · 0.80
formatMethod · 0.65
sortMethod · 0.45

Tested by

no test coverage detected