Skip to content

Commit bdf7895

Browse files
authored
Update thread dump file name (#3131)
1 parent c5b190a commit bdf7895

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

agent/agent/src/main/java/com/microsoft/applicationinsights/agent/StartupProfiler.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
final class StartupProfiler {
1919

20-
private static final String STACKTRACES = "stacktrace.txt";
21-
2220
@SuppressWarnings("SystemOut")
2321
public static void start() {
2422
String tempDirectory = System.getProperty("java.io.tmpdir");
@@ -28,7 +26,7 @@ public static void start() {
2826
return;
2927
}
3028

31-
File dumpFile = new File(folder, STACKTRACES);
29+
File dumpFile = new File(folder, getThreadDumpFilename());
3230
System.out.println("Writing startup profiler to '" + dumpFile.getPath() + "'");
3331

3432
PrintWriter printWriter;
@@ -50,6 +48,10 @@ private static void start(PrintWriter out) {
5048
thread.start();
5149
}
5250

51+
private static String getThreadDumpFilename() {
52+
return "stacktrace-" + System.currentTimeMillis() + ".txt";
53+
}
54+
5355
private static class ThreadDump implements Runnable {
5456

5557
private final PrintWriter out;

0 commit comments

Comments
 (0)