示例#1
0
// Meter configures the database metrics collectors and
func (self *LDBDatabase) Meter(prefix string) {
	// Initialize all the metrics collector at the requested prefix
	self.getTimer = metrics.NewTimer(prefix + "user/gets")
	self.putTimer = metrics.NewTimer(prefix + "user/puts")
	self.delTimer = metrics.NewTimer(prefix + "user/dels")
	self.missMeter = metrics.NewMeter(prefix + "user/misses")
	self.readMeter = metrics.NewMeter(prefix + "user/reads")
	self.writeMeter = metrics.NewMeter(prefix + "user/writes")
	self.compTimeMeter = metrics.NewMeter(prefix + "compact/time")
	self.compReadMeter = metrics.NewMeter(prefix + "compact/input")
	self.compWriteMeter = metrics.NewMeter(prefix + "compact/output")

	// Create a quit channel for the periodic collector and run it
	self.quitLock.Lock()
	self.quitChan = make(chan chan error)
	self.quitLock.Unlock()

	go self.meter(3 * time.Second)
}
示例#2
0
	"github.com/hashicorp/golang-lru"
	"github.com/shiftcurrency/shift/common"
	"github.com/shiftcurrency/shift/core/state"
	"github.com/shiftcurrency/shift/core/types"
	"github.com/shiftcurrency/shift/event"
	"github.com/shiftcurrency/shift/logger"
	"github.com/shiftcurrency/shift/logger/glog"
	"github.com/shiftcurrency/shift/metrics"
	"github.com/shiftcurrency/shift/pow"
)

var (
	chainlogger = logger.NewLogger("CHAIN")
	jsonlogger  = logger.NewJsonLogger()

	blockInsertTimer = metrics.NewTimer("chain/inserts")

	ErrNoGenesis = errors.New("Genesis not found in chain")
)

const (
	blockCacheLimit     = 256
	maxFutureBlocks     = 256
	maxTimeFutureBlocks = 30
	checkpointLimit     = 200
)

type ChainManager struct {
	//eth          EthManager
	chainDb      common.Database
	sqlDB        types.SQLDatabase
示例#3
0
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Contains the metrics collected by the fetcher.

package fetcher

import (
	"github.com/shiftcurrency/shift/metrics"
)

var (
	announceMeter  = metrics.NewMeter("eth/sync/RemoteAnnounces")
	announceTimer  = metrics.NewTimer("eth/sync/LocalAnnounces")
	broadcastMeter = metrics.NewMeter("eth/sync/RemoteBroadcasts")
	broadcastTimer = metrics.NewTimer("eth/sync/LocalBroadcasts")
	discardMeter   = metrics.NewMeter("eth/sync/DiscardedBlocks")
	futureMeter    = metrics.NewMeter("eth/sync/FutureBlocks")
)