Set user-friendly name of Blockbook's process
parent
78300b998e
commit
8f5835a94d
|
@ -67,6 +67,12 @@
|
|||
revision = "1d4478f51bed434f1dadf96dcd9b43aabac66795"
|
||||
version = "v1.7"
|
||||
|
||||
[[projects]]
|
||||
branch = "master"
|
||||
name = "github.com/erikdubbelboer/gspt"
|
||||
packages = ["."]
|
||||
revision = "e39e726e09cc23d1ccf13b36ce10dbdb4a4510e0"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/ethereum/go-ethereum"
|
||||
packages = [".","common","common/hexutil","common/math","core/types","crypto","crypto/secp256k1","crypto/sha3","ethclient","ethdb","log","metrics","params","rlp","rpc","trie"]
|
||||
|
@ -244,6 +250,6 @@
|
|||
[solve-meta]
|
||||
analyzer-name = "dep"
|
||||
analyzer-version = 1
|
||||
inputs-digest = "03817720a4b1b5011cc64018a1344ed3fb4d8228af41c86856069f57851b3819"
|
||||
inputs-digest = "98fb9a6252acd86d1c0a4b09a42e34673c2ccd6327caf49ed85bcee573601d95"
|
||||
solver-name = "gps-cdcl"
|
||||
solver-version = 1
|
||||
|
|
28
blockbook.go
28
blockbook.go
|
@ -1,10 +1,17 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"blockbook/bchain"
|
||||
"blockbook/bchain/coins"
|
||||
"blockbook/common"
|
||||
"blockbook/db"
|
||||
"blockbook/server"
|
||||
"context"
|
||||
"flag"
|
||||
"log"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
|
@ -12,18 +19,9 @@ import (
|
|||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/juju/errors"
|
||||
|
||||
"blockbook/bchain"
|
||||
"blockbook/bchain/coins"
|
||||
"blockbook/common"
|
||||
"blockbook/db"
|
||||
"blockbook/server"
|
||||
|
||||
"github.com/erikdubbelboer/gspt"
|
||||
"github.com/golang/glog"
|
||||
|
||||
"net/http"
|
||||
_ "net/http/pprof"
|
||||
"github.com/juju/errors"
|
||||
)
|
||||
|
||||
// debounce too close requests for resync
|
||||
|
@ -156,6 +154,8 @@ func main() {
|
|||
glog.Fatal("config: ", err)
|
||||
}
|
||||
|
||||
gspt.SetProcTitle("blockbook-" + normalizeName(coin))
|
||||
|
||||
metrics, err := common.GetMetrics(coin)
|
||||
if err != nil {
|
||||
glog.Fatal("metrics: ", err)
|
||||
|
@ -508,3 +508,9 @@ func printResult(txid string, vout uint32, isOutput bool) error {
|
|||
glog.Info(txid, vout, isOutput)
|
||||
return nil
|
||||
}
|
||||
|
||||
func normalizeName(s string) string {
|
||||
s = strings.ToLower(s)
|
||||
s = strings.Replace(s, " ", "-", -1)
|
||||
return s
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue