Add app name to dump filename (#397)
This commit is contained in:
@@ -35,15 +35,17 @@ class HeapDumpCreator {
|
||||
if (enableCreateDumps && dumpsPathExists) {
|
||||
executorService.scheduleAtFixedRate({ dumpCheckTask(dumpsPath) }, 0, 30, TimeUnit.MINUTES)
|
||||
|
||||
configHeapDump(dumpsPath)
|
||||
val appName = envVars["DSHACKLE_APP_NAME"] ?: "dshackle"
|
||||
|
||||
configHeapDump(dumpsPath, appName)
|
||||
} else {
|
||||
log.warn("Heap dump creation is turned off")
|
||||
}
|
||||
}
|
||||
|
||||
private fun configHeapDump(dumpsPath: String) {
|
||||
private fun configHeapDump(dumpsPath: String, appName: String) {
|
||||
val date = SimpleDateFormat("yyyyMMddHHmmss").format(Date())
|
||||
val fileName = "$dumpsPath/heap_$date.hprof"
|
||||
val fileName = "$dumpsPath/heap_${date}_$appName.hprof"
|
||||
|
||||
val bean = ManagementFactory.newPlatformMXBeanProxy(
|
||||
ManagementFactory.getPlatformMBeanServer(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
spring:
|
||||
application:
|
||||
max-metadata-size: ${MAX_METADATA_SIZE:16384}
|
||||
name: ${DRPC_APP_NAME:dshackle}
|
||||
name: ${DSHACKLE_APP_NAME:dshackle}
|
||||
zipkin:
|
||||
enabled: ${ENABLE_COLLECT_SPANS:false}
|
||||
base-url: ${ZIPKIN_URL:https://trace.drpc.dev/}
|
||||
|
||||
Reference in New Issue
Block a user