From deaf9f9bead003357a4bcd231f87f24e7d36b4bd Mon Sep 17 00:00:00 2001 From: Nidhi Date: Mon, 12 Aug 2024 19:29:47 +0530 Subject: [PATCH] chore: Added multiple scripts to trigger profiles (#35546) --- deploy/docker/fs/opt/appsmith/record-heap-dump.sh | 10 ++++++++++ deploy/docker/fs/opt/appsmith/record-thread-dump.sh | 10 ++++++++++ deploy/docker/fs/opt/appsmith/thread-profile-start.sh | 10 ++++++++++ deploy/docker/fs/opt/appsmith/thread-profile-stop.sh | 8 ++++++++ 4 files changed, 38 insertions(+) create mode 100755 deploy/docker/fs/opt/appsmith/record-heap-dump.sh create mode 100755 deploy/docker/fs/opt/appsmith/record-thread-dump.sh create mode 100755 deploy/docker/fs/opt/appsmith/thread-profile-start.sh create mode 100755 deploy/docker/fs/opt/appsmith/thread-profile-stop.sh diff --git a/deploy/docker/fs/opt/appsmith/record-heap-dump.sh b/deploy/docker/fs/opt/appsmith/record-heap-dump.sh new file mode 100755 index 0000000000..4148a1c45a --- /dev/null +++ b/deploy/docker/fs/opt/appsmith/record-heap-dump.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -o errexit +set -o pipefail +set -o nounset +set -o noglob + +location=/appsmith-stacks/heap_dumps/ad-hoc/$(date "+%Y_%m_%d_%H_%S")/heap-profile; +mkdir -p $location; +jcmd $(pgrep -f -- "-jar\sserver.jar") GC.heap_dump filename=$location/${HOSTNAME}.log \ No newline at end of file diff --git a/deploy/docker/fs/opt/appsmith/record-thread-dump.sh b/deploy/docker/fs/opt/appsmith/record-thread-dump.sh new file mode 100755 index 0000000000..0b44d56d94 --- /dev/null +++ b/deploy/docker/fs/opt/appsmith/record-thread-dump.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -o errexit +set -o pipefail +set -o nounset +set -o noglob + +location=/appsmith-stacks/heap_dumps/ad-hoc/$(date "+%Y_%m_%d_%H_%S")/thread-profile; +mkdir -p $location; +jcmd $(pgrep -f -- "-jar\sserver.jar") Thread.print > $location/trace-${HOSTNAME}.log \ No newline at end of file diff --git a/deploy/docker/fs/opt/appsmith/thread-profile-start.sh b/deploy/docker/fs/opt/appsmith/thread-profile-start.sh new file mode 100755 index 0000000000..f7aed6c2c4 --- /dev/null +++ b/deploy/docker/fs/opt/appsmith/thread-profile-start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -o errexit +set -o pipefail +set -o nounset +set -o noglob + +location=/appsmith-stacks/heap_dumps/ad-hoc/$(date "+%Y_%m_%d_%H_%S")/thread-profile; +mkdir -p $location; +jcmd $(pgrep -f -- "-jar\sserver.jar") JFR.start name=profile filename=$location/profile-${HOSTNAME}.jfr \ No newline at end of file diff --git a/deploy/docker/fs/opt/appsmith/thread-profile-stop.sh b/deploy/docker/fs/opt/appsmith/thread-profile-stop.sh new file mode 100755 index 0000000000..b4d77507e1 --- /dev/null +++ b/deploy/docker/fs/opt/appsmith/thread-profile-stop.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -o errexit +set -o pipefail +set -o nounset +set -o noglob + +jcmd $(pgrep -f -- "-jar\sserver.jar") JFR.dump name=profile \ No newline at end of file