Merge branch 'master' into indexv4

This commit is contained in:
Martin Boehm 2019-01-03 18:09:30 +01:00
commit 9518f94714
3 changed files with 15 additions and 10 deletions

View File

@ -65,6 +65,7 @@ var (
noTxCache = flag.Bool("notxcache", false, "disable tx cache")
computeColumnStats = flag.Bool("computedbstats", false, "compute column stats and exit")
dbStatsPeriodHours = flag.Int("dbstatsperiod", 24, "period of db stats collection in hours, 0 disables stats collection")
// resync index at least each resyncIndexPeriodMs (could be more often if invoked by message from ZeroMQ)
resyncIndexPeriodMs = flag.Int("resyncindexperiod", 935093, "resync index period in milliseconds")
@ -459,13 +460,17 @@ func storeInternalStateLoop() {
}()
var computeRunning bool
lastCompute := time.Now()
// randomize the duration between ComputeInternalStateColumnStats to avoid peaks after reboot of machine with multiple blockbooks
computePeriod := 23*time.Hour + time.Duration(rand.Float64()*float64((4*time.Hour).Nanoseconds()))
lastAppInfo := time.Now()
logAppInfoPeriod := 15 * time.Minute
glog.Info("storeInternalStateLoop starting with db stats recompute period ", computePeriod)
// randomize the duration between ComputeInternalStateColumnStats to avoid peaks after reboot of machine with multiple blockbooks
computePeriod := time.Duration(*dbStatsPeriodHours)*time.Hour + time.Duration(rand.Float64()*float64((4*time.Hour).Nanoseconds()))
if (*dbStatsPeriodHours) > 0 {
glog.Info("storeInternalStateLoop starting with db stats recompute period ", computePeriod)
} else {
glog.Info("storeInternalStateLoop starting with db stats compute disabled")
}
tickAndDebounce(storeInternalStatePeriodMs*time.Millisecond, (storeInternalStatePeriodMs-1)*time.Millisecond, chanStoreInternalState, func() {
if !computeRunning && lastCompute.Add(computePeriod).Before(time.Now()) {
if (*dbStatsPeriodHours) > 0 && !computeRunning && lastCompute.Add(computePeriod).Before(time.Now()) {
computeRunning = true
go func() {
err := index.ComputeInternalStateColumnStats(stopCompute)

View File

@ -22,10 +22,10 @@
"package_name": "backend-bitcoin",
"package_revision": "satoshilabs-1",
"system_user": "bitcoin",
"version": "0.17.0",
"binary_url": "https://bitcoin.org/bin/bitcoin-core-0.17.0/bitcoin-0.17.0-x86_64-linux-gnu.tar.gz",
"version": "0.17.1",
"binary_url": "https://bitcoin.org/bin/bitcoin-core-0.17.1/bitcoin-0.17.1-x86_64-linux-gnu.tar.gz",
"verification_type": "gpg-sha256",
"verification_source": "https://bitcoin.org/bin/bitcoin-core-0.17.0/SHA256SUMS.asc",
"verification_source": "https://bitcoin.org/bin/bitcoin-core-0.17.1/SHA256SUMS.asc",
"extract_command": "tar -C backend --strip 1 -xf",
"exclude_files": [
"bin/bitcoin-qt"

View File

@ -22,10 +22,10 @@
"package_name": "backend-bitcoin-testnet",
"package_revision": "satoshilabs-1",
"system_user": "bitcoin",
"version": "0.17.0",
"binary_url": "https://bitcoin.org/bin/bitcoin-core-0.17.0/bitcoin-0.17.0-x86_64-linux-gnu.tar.gz",
"version": "0.17.1",
"binary_url": "https://bitcoin.org/bin/bitcoin-core-0.17.1/bitcoin-0.17.1-x86_64-linux-gnu.tar.gz",
"verification_type": "gpg-sha256",
"verification_source": "https://bitcoin.org/bin/bitcoin-core-0.17.0/SHA256SUMS.asc",
"verification_source": "https://bitcoin.org/bin/bitcoin-core-0.17.1/SHA256SUMS.asc",
"extract_command": "tar -C backend --strip 1 -xf",
"exclude_files": [
"bin/bitcoin-qt"