1
0
mirror of synced 2025-04-18 12:24:02 +03:00

Update hockeypuck wrapper to support cpu and memory profiling

This commit is contained in:
Thomas Cuthbert 2020-07-09 07:58:25 +08:00 committed by Thomas Cuthbert
parent e9e0baabed
commit 8a9525c19a
3 changed files with 26 additions and 1 deletions

View File

@ -66,6 +66,18 @@ Or use LXD for a lighter-weight isolated build:
SNAPCRAFT_BUILD_ENVIRONMENT=lxd snapcraft snap
Enabling cpu or memory profiling:
sudo snap set hockeypuck cpuprof=1
sudo snap set hockeypuck memprof=1
sudo systemctl restart snap.hockeypuck.hockeypuck.service
Disabling cpu or memory profiling:
sudo snap unset hockeypuck cpuprof
sudo snap unset hockeypuck memprof
sudo systemctl restart snap.hockeypuck.hockeypuck.service
## Ubuntu package maintainers
In order to release a new version of hockeypuck:

3
snap/hooks/configure vendored Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
exit 0

View File

@ -3,10 +3,20 @@
set -euo pipefail
CONFIG=$SNAP_COMMON/config
ARGS="-config $CONFIG"
if [ ! -f "$CONFIG" ]; then
echo "Missing config file $CONFIG."
echo "Use 'hockeypuck.config' to create/edit config file"
exit 1
fi
exec $SNAP/bin/hockeypuck -config $CONFIG
CPUPROF="$(snapctl get cpuprof)"
MEMPROF="$(snapctl get memprof)"
if [ -n "$CPUPROF" ]; then
ARGS="$ARGS -cpuprof"
fi
if [ -n "$MEMPROF" ]; then
ARGS="$ARGS -memprof"
fi
exec $SNAP/bin/hockeypuck $ARGS