Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cmd/tomo/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,24 @@ package main
import (
"encoding/json"
"fmt"
"github.com/tomochain/tomochain/core/rawdb"
"os"
"runtime"
"strconv"
"sync/atomic"
"time"

"gopkg.in/urfave/cli.v1"

"github.com/tomochain/tomochain/cmd/utils"
"github.com/tomochain/tomochain/common"
"github.com/tomochain/tomochain/console"
"github.com/tomochain/tomochain/core"
"github.com/tomochain/tomochain/core/rawdb"
"github.com/tomochain/tomochain/core/state"
"github.com/tomochain/tomochain/core/types"
"github.com/tomochain/tomochain/eth/downloader"
"github.com/tomochain/tomochain/event"
"github.com/tomochain/tomochain/log"
"gopkg.in/urfave/cli.v1"
)

var (
Expand Down Expand Up @@ -68,6 +69,8 @@ It expects the genesis file as argument.`,
utils.GCModeFlag,
utils.CacheDatabaseFlag,
utils.CacheGCFlag,
utils.MetricsEnabledFlag,
utils.MetricsEnabledExpensiveFlag,
},
Category: "BLOCKCHAIN COMMANDS",
Description: `
Expand Down
4 changes: 3 additions & 1 deletion cmd/tomo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import (
"strings"
"time"

"gopkg.in/urfave/cli.v1"

"github.com/tomochain/tomochain/accounts"
"github.com/tomochain/tomochain/accounts/keystore"
"github.com/tomochain/tomochain/cmd/utils"
Expand All @@ -36,7 +38,6 @@ import (
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/metrics"
"github.com/tomochain/tomochain/node"
"gopkg.in/urfave/cli.v1"
)

const (
Expand Down Expand Up @@ -118,6 +119,7 @@ var (
utils.RPCVirtualHostsFlag,
utils.EthStatsURLFlag,
utils.MetricsEnabledFlag,
utils.MetricsEnabledExpensiveFlag,
//utils.FakePoWFlag,
//utils.NoCompactionFlag,
//utils.GpoBlocksFlag,
Expand Down
8 changes: 6 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import (
"github.com/tomochain/tomochain/eth/gasprice"
"github.com/tomochain/tomochain/ethdb"
"github.com/tomochain/tomochain/log"
"github.com/tomochain/tomochain/metrics"
"github.com/tomochain/tomochain/node"
"github.com/tomochain/tomochain/p2p"
"github.com/tomochain/tomochain/p2p/discover"
Expand Down Expand Up @@ -355,10 +354,15 @@ var (
Name: "ethstats",
Usage: "Reporting URL of a ethstats service (nodename:secret@host:port)",
}
// Metrics flags
MetricsEnabledFlag = cli.BoolFlag{
Name: metrics.MetricsEnabledFlag,
Name: "metrics",
Usage: "Enable metrics collection and reporting",
}
MetricsEnabledExpensiveFlag = &cli.BoolFlag{
Name: "metrics.expensive",
Usage: "Enable expensive metrics collection and reporting",
}
FakePoWFlag = cli.BoolFlag{
Name: "fakepow",
Usage: "Disables proof-of-work verification",
Expand Down
2 changes: 1 addition & 1 deletion consensus/ethash/ethash.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ func (ethash *Ethash) SetThreads(threads int) {
// Hashrate implements PoW, returning the measured rate of the search invocations
// per second over the last minute.
func (ethash *Ethash) Hashrate() float64 {
return ethash.hashrate.Rate1()
return ethash.hashrate.Snapshot().Rate1()
}

// APIs implements consensus.Engine, returning the user facing RPC APIs. Currently
Expand Down
Loading