mirror of https://github.com/statping/statping
urgent bug fix 100% CPU, pprof with DEBUG env,
parent
6fd87b7a2f
commit
1b68476b81
|
@ -143,160 +143,160 @@ jobs:
|
|||
env:
|
||||
COVERALLS: ${{ secrets.COVERALLS }}
|
||||
|
||||
# test-postman-sqlite:
|
||||
# needs: compile
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - uses: actions/setup-go@v2
|
||||
# with:
|
||||
# go-version: '1.14.2'
|
||||
#
|
||||
# - name: Setting ENV's
|
||||
# run: |
|
||||
# echo "::add-path::$(go env GOPATH)/bin"
|
||||
# echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||
# echo ::set-env name=VERSION::$(cat version.txt)
|
||||
# shell: bash
|
||||
#
|
||||
# - name: Download Compiled Frontend (rice-box.go)
|
||||
# uses: actions/download-artifact@v1
|
||||
# with:
|
||||
# name: static-rice-box
|
||||
# path: ./source
|
||||
#
|
||||
# - name: Install Statping
|
||||
# env:
|
||||
# VERSION: ${{ env.VERSION }}
|
||||
# run: |
|
||||
# make build
|
||||
# chmod +x statping
|
||||
# mv statping $(go env GOPATH)/bin/
|
||||
#
|
||||
# - name: Run Statping
|
||||
# run: |
|
||||
# API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||
# sleep 5
|
||||
#
|
||||
# - name: Postman SQLite Tests
|
||||
# uses: matt-ball/newman-action@master
|
||||
# with:
|
||||
# apiKey: ${{ secrets.POSTMAN_API }}
|
||||
# collection: ./dev/postman.json
|
||||
# environment: ./dev/postman_env_sqlite.json
|
||||
# timeoutRequest: 30000
|
||||
# delayRequest: 600
|
||||
#
|
||||
# test-postman-mysql:
|
||||
# needs: compile
|
||||
# runs-on: ubuntu-latest
|
||||
#
|
||||
# services:
|
||||
# mysql:
|
||||
# image: mysql:5.7
|
||||
# env:
|
||||
# MYSQL_ROOT_PASSWORD: password123
|
||||
# MYSQL_DATABASE: statping
|
||||
# ports:
|
||||
# - 3306:3306
|
||||
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - uses: actions/setup-go@v2
|
||||
# with:
|
||||
# go-version: '1.14.2'
|
||||
#
|
||||
# - name: Setting ENV's
|
||||
# run: |
|
||||
# echo "::add-path::$(go env GOPATH)/bin"
|
||||
# echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||
# echo ::set-env name=VERSION::$(cat version.txt)
|
||||
# shell: bash
|
||||
#
|
||||
# - name: Download Compiled Frontend (rice-box.go)
|
||||
# uses: actions/download-artifact@v1
|
||||
# with:
|
||||
# name: static-rice-box
|
||||
# path: ./source
|
||||
#
|
||||
# - name: Install Statping
|
||||
# env:
|
||||
# VERSION: ${{ env.VERSION }}
|
||||
# run: |
|
||||
# make build
|
||||
# chmod +x statping
|
||||
# mv statping $(go env GOPATH)/bin/
|
||||
#
|
||||
# - name: Run Statping
|
||||
# run: |
|
||||
# API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||
# sleep 5
|
||||
#
|
||||
# - name: Postman MySQL Tests
|
||||
# uses: matt-ball/newman-action@master
|
||||
# with:
|
||||
# apiKey: ${{ secrets.POSTMAN_API }}
|
||||
# collection: ./dev/postman.json
|
||||
# environment: ./dev/postman_env_mysql.json
|
||||
# timeoutRequest: 30000
|
||||
# delayRequest: 600
|
||||
#
|
||||
# test-postman-postgres:
|
||||
# needs: compile
|
||||
# runs-on: ubuntu-latest
|
||||
#
|
||||
# services:
|
||||
# postgres:
|
||||
# image: postgres:10.8
|
||||
# env:
|
||||
# POSTGRES_USER: root
|
||||
# POSTGRES_PASSWORD: password123
|
||||
# POSTGRES_DB: statping
|
||||
# ports:
|
||||
# - 5432:5432
|
||||
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v2
|
||||
# - uses: actions/setup-go@v2
|
||||
# with:
|
||||
# go-version: '1.14.2'
|
||||
#
|
||||
# - name: Setting ENV's
|
||||
# run: |
|
||||
# echo "::add-path::$(go env GOPATH)/bin"
|
||||
# echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||
# echo ::set-env name=VERSION::$(cat version.txt)
|
||||
# shell: bash
|
||||
#
|
||||
# - name: Download Compiled Frontend (rice-box.go)
|
||||
# uses: actions/download-artifact@v1
|
||||
# with:
|
||||
# name: static-rice-box
|
||||
# path: ./source
|
||||
#
|
||||
# - name: Install Statping
|
||||
# env:
|
||||
# VERSION: ${{ env.VERSION }}
|
||||
# run: |
|
||||
# make build
|
||||
# chmod +x statping
|
||||
# mv statping $(go env GOPATH)/bin/
|
||||
#
|
||||
# - name: Run Statping
|
||||
# run: |
|
||||
# API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||
# sleep 5
|
||||
#
|
||||
# - name: Postman Postgres Tests
|
||||
# uses: matt-ball/newman-action@master
|
||||
# with:
|
||||
# apiKey: ${{ secrets.POSTMAN_API }}
|
||||
# collection: ./dev/postman.json
|
||||
# environment: ./dev/postman_env_postgres.json
|
||||
# timeoutRequest: 30000
|
||||
# delayRequest: 600
|
||||
test-postman-sqlite:
|
||||
needs: compile
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.14.2'
|
||||
|
||||
- name: Setting ENV's
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||
echo ::set-env name=VERSION::$(cat version.txt)
|
||||
shell: bash
|
||||
|
||||
- name: Download Compiled Frontend (rice-box.go)
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: static-rice-box
|
||||
path: ./source
|
||||
|
||||
- name: Install Statping
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: |
|
||||
make build
|
||||
chmod +x statping
|
||||
mv statping $(go env GOPATH)/bin/
|
||||
|
||||
- name: Run Statping
|
||||
run: |
|
||||
API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||
sleep 5
|
||||
|
||||
- name: Postman SQLite Tests
|
||||
uses: matt-ball/newman-action@master
|
||||
with:
|
||||
apiKey: ${{ secrets.POSTMAN_API }}
|
||||
collection: ./dev/postman.json
|
||||
environment: ./dev/postman_env_sqlite.json
|
||||
timeoutRequest: 30000
|
||||
delayRequest: 600
|
||||
|
||||
test-postman-mysql:
|
||||
needs: compile
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: password123
|
||||
MYSQL_DATABASE: statping
|
||||
ports:
|
||||
- 3306:3306
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.14.2'
|
||||
|
||||
- name: Setting ENV's
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||
echo ::set-env name=VERSION::$(cat version.txt)
|
||||
shell: bash
|
||||
|
||||
- name: Download Compiled Frontend (rice-box.go)
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: static-rice-box
|
||||
path: ./source
|
||||
|
||||
- name: Install Statping
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: |
|
||||
make build
|
||||
chmod +x statping
|
||||
mv statping $(go env GOPATH)/bin/
|
||||
|
||||
- name: Run Statping
|
||||
run: |
|
||||
API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||
sleep 5
|
||||
|
||||
- name: Postman MySQL Tests
|
||||
uses: matt-ball/newman-action@master
|
||||
with:
|
||||
apiKey: ${{ secrets.POSTMAN_API }}
|
||||
collection: ./dev/postman.json
|
||||
environment: ./dev/postman_env_mysql.json
|
||||
timeoutRequest: 30000
|
||||
delayRequest: 600
|
||||
|
||||
test-postman-postgres:
|
||||
needs: compile
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10.8
|
||||
env:
|
||||
POSTGRES_USER: root
|
||||
POSTGRES_PASSWORD: password123
|
||||
POSTGRES_DB: statping
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '1.14.2'
|
||||
|
||||
- name: Setting ENV's
|
||||
run: |
|
||||
echo "::add-path::$(go env GOPATH)/bin"
|
||||
echo "::add-path::/opt/hostedtoolcache/node/10.20.1/x64/bin"
|
||||
echo ::set-env name=VERSION::$(cat version.txt)
|
||||
shell: bash
|
||||
|
||||
- name: Download Compiled Frontend (rice-box.go)
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: static-rice-box
|
||||
path: ./source
|
||||
|
||||
- name: Install Statping
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: |
|
||||
make build
|
||||
chmod +x statping
|
||||
mv statping $(go env GOPATH)/bin/
|
||||
|
||||
- name: Run Statping
|
||||
run: |
|
||||
API_SECRET=demosecret123 statping --port=8585 > /dev/null &
|
||||
sleep 5
|
||||
|
||||
- name: Postman Postgres Tests
|
||||
uses: matt-ball/newman-action@master
|
||||
with:
|
||||
apiKey: ${{ secrets.POSTMAN_API }}
|
||||
collection: ./dev/postman.json
|
||||
environment: ./dev/postman_env_postgres.json
|
||||
timeoutRequest: 30000
|
||||
delayRequest: 600
|
||||
|
||||
build-binaries:
|
||||
needs: compile
|
||||
|
@ -361,7 +361,7 @@ jobs:
|
|||
path: ./build
|
||||
|
||||
upload-release:
|
||||
needs: [test, build-binaries]
|
||||
needs: [test, test-postman-sqlite, test-postman-mysql, test-postman-postgres, build-binaries]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# 0.90.47 (06-10-2020)
|
||||
- Fixed Urgent bug taking 100% of CPU (Timer)
|
||||
- Modified HTTP server, now in it's own go routine/channel
|
||||
- Fixed Service form for editing
|
||||
- Added pprof golang debugging http server if `GO_ENV` == "test"
|
||||
|
@ -8,6 +9,7 @@
|
|||
- Added `LOGS_MAX_COUNT`
|
||||
- Added `LOGS_MAX_AGE`
|
||||
- Added `LOGS_MAX_SIZE`
|
||||
- Added `DEBUG` (starts a pprof golang debugging http server on port 9090, defaults to false)
|
||||
- Confirmed `DISABLE_LOGS` is working
|
||||
- Modified Mobile Notifier to fit new push notification server endpoint
|
||||
- PR Merged: Fix time conversion in overview and charts #645
|
||||
|
|
|
@ -34,12 +34,12 @@ CacheRoutine:
|
|||
case <-s.running:
|
||||
break CacheRoutine
|
||||
case <-time.After(duration):
|
||||
duration = 5 * time.Second
|
||||
for k, v := range s.List() {
|
||||
if v.Expired() {
|
||||
s.Delete(k)
|
||||
}
|
||||
}
|
||||
duration = 5 * time.Second
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,8 +67,6 @@ func RunHTTPServer() error {
|
|||
select {
|
||||
case err := <-httpError:
|
||||
return err
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ func Router() *mux.Router {
|
|||
r.Use(sendLog)
|
||||
}
|
||||
|
||||
if utils.Params.GetString("GO_ENV") == "test" {
|
||||
if utils.Params.GetBool("DEBUG") {
|
||||
go func() {
|
||||
log.Infoln("Starting pprof web server on http://0.0.0.0:9090")
|
||||
r := http.NewServeMux()
|
||||
|
|
|
@ -47,8 +47,6 @@ CheckLoop:
|
|||
} else {
|
||||
s.SleepDuration = s.Checkpoint.Sub(time.Now())
|
||||
}
|
||||
default:
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ func InitEnvs() {
|
|||
Params.SetDefault("DISABLE_HTTP", false)
|
||||
Params.SetDefault("STATPING_DIR", defaultDir)
|
||||
Params.SetDefault("GO_ENV", "production")
|
||||
Params.SetDefault("DEBUG", false)
|
||||
Params.SetDefault("DB_CONN", "")
|
||||
Params.SetDefault("DISABLE_LOGS", false)
|
||||
Params.SetDefault("USE_ASSETS", false)
|
||||
|
|
Loading…
Reference in New Issue