Documentation ¶
Index ¶
- Constants
- Variables
- func EnableAnalyzer(flag bool)
- func InitializePprofDumper(logger log.Logger, dumpPath string, coolDownStr string, abciElapsed int64)
- func OnAppBeginBlockEnter(height int64)
- func OnAppDeliverTxEnter()
- func OnCommitDone()
- func SetDynamicConfig(c IDynamicConfig)
- func SetInfoObject(e IElapsedTimeInfos)
- func StartTxLog(oper string)
- func StopTxLog(oper string)
- type Analyzer
- type BaseStatistics
- type DbRecord
- type EmptyTimeInfo
- type IDynamicConfig
- type IElapsedTimeInfos
- type MockDynamicConfig
- type StatisticsCell
- type Summary
- type Tracer
- func (t *Tracer) EnableSummary()
- func (t *Tracer) Format() string
- func (t *Tracer) FormatRepeatingPins(ignoredTags string) string
- func (t *Tracer) GetElapsedTime() int64
- func (t *Tracer) Pin(format string, args ...interface{})
- func (t *Tracer) RepeatingPin(format string, args ...interface{})
- func (t *Tracer) Reset()
- func (t *Tracer) SetWorkloadStatistic(wls *WorkloadStatistic)
- type WorkloadStatistic
Constants ¶
const ( //----- DeliverTx DeliverTx = "DeliverTx" TxDecoder = "TxDecoder" //----- RunTx details ValTxMsgs = "valTxMsgs" RunAnte = "RunAnte" RunMsg = "RunMsg" Refund = "refund" EvmHandler = "EvmHandler" //------ RunAnte details CacheTxContext = "cacheTxContext" AnteChain = "AnteChain" AnteOther = "AnteOther" CacheStoreWrite = "cacheStoreWrite" //----- handler details ParseChainID = "ParseChainID" VerifySig = "VerifySig" Txhash = "txhash" SaveTx = "SaveTx" TransitionDb = "TransitionDb" Bloomfilter = "Bloomfilter" EmitEvents = "EmitEvents" HandlerDefer = "handler_defer" )
const ( GasUsed = "GasUsed" SimGasUsed = "SimGasUsed" Produce = "Produce" RunTx = "RunTx" LastRun = "lastRun" Height = "Height" Tx = "Tx" SimTx = "SimTx" BlockSize = "BlockSize" Elapsed = "Elapsed" CommitRound = "CommitRound" Round = "Round" BlockParts = "BlockParts" Evm = "Evm" Iavl = "Iavl" FlatKV = "FlatKV" //RecvBlock = "RecvBlock" First2LastPart = "First2LastPart" SigCacheRatio = "SigCacheRatio" DeliverTxs = "DeliverTxs" EvmHandlerDetail = "EvmHandlerDetail" RunAnteDetail = "RunAnteDetail" AnteChainDetail = "AnteChainDetail" Delta = "Delta" InvalidTxs = "InvalidTxs" Abci = "abci" //SaveResp = "saveResp" Persist = "persist" PersistDetails = "persistDetails" PreChange = "preChange" FlushCache = "flushCache" CommitStores = "commitStores" FlushMeta = "flushMeta" //MempoolUpdate = "mpUpdate" //SaveState = "saveState" ApplyBlock = "ApplyBlock" Consensus = "Consensus" LastBlockTime = "LastBlockTime" BTInterval = "BTInterval" RecommendedGP = "RecommendedGP" IsCongested = "IsCongested" UpdateState = "UpdateState" Waiting = "Waiting" MempoolCheckTxCnt = "CheckTx" MempoolTxsCnt = "MempoolTxs" MempoolCheckTxTime = "CheckTxTime" CompressBlock = "Compress" UncompressBlock = "Uncompress" Prerun = "Prerun" IavlRuntime = "IavlRuntime" BlockPartsP2P = "BlockPartsP2P" Workload = "Workload" ACOffset = "ACOffset" )
const ( READ = 1 WRITE = 2 EVMALL = 3 UNKNOWN_TYPE = 4 EVM_FORMAT = "read<%dms>, write<%dms>, execute<%dms>" EVMCORE = "evmcore" )
const FlagEnableAnalyzer string = "enable-analyzer"
Variables ¶
var ( STATEDB_WRITE = []string{"AddBalance", "SubBalance", "SetNonce", "SetState", "SetCode", "AddLog", "AddPreimage", "AddRefund", "SubRefund", "AddAddressToAccessList", "AddSlotToAccessList", "PrepareAccessList", "AddressInAccessList", "Suicide", "CreateAccount", "ForEachStorage"} STATEDB_READ = []string{"SlotInAccessList", "GetBalance", "GetNonce", "GetCode", "GetCodeSize", "GetCodeHash", "GetState", "GetCommittedState", "GetRefund", "HasSuicided", "Snapshot", "RevertToSnapshot", "Empty", "Exist"} EVM_OPER = []string{EVMCORE} )
Functions ¶
func EnableAnalyzer ¶
func EnableAnalyzer(flag bool)
func InitializePprofDumper ¶
func OnAppBeginBlockEnter ¶
func OnAppBeginBlockEnter(height int64)
func OnAppDeliverTxEnter ¶
func OnAppDeliverTxEnter()
func OnCommitDone ¶
func OnCommitDone()
func SetDynamicConfig ¶
func SetDynamicConfig(c IDynamicConfig)
func SetInfoObject ¶
func SetInfoObject(e IElapsedTimeInfos)
func StartTxLog ¶
func StartTxLog(oper string)
Types ¶
type BaseStatistics ¶
type DbRecord ¶
type DbRecord struct {
// contains filtered or unexported fields
}
func (*DbRecord) AddOperType ¶
func (*DbRecord) GetOperType ¶
type EmptyTimeInfo ¶
type EmptyTimeInfo struct { }
func (*EmptyTimeInfo) AddInfo ¶
func (e *EmptyTimeInfo) AddInfo(key string, info string)
func (*EmptyTimeInfo) Dump ¶
func (e *EmptyTimeInfo) Dump(logger interface{})
func (*EmptyTimeInfo) GetElapsedTime ¶
func (e *EmptyTimeInfo) GetElapsedTime() int64
func (*EmptyTimeInfo) SetElapsedTime ¶
func (e *EmptyTimeInfo) SetElapsedTime(elapsedTime int64)
type IDynamicConfig ¶
type IDynamicConfig interface {
GetEnableAnalyzer() bool
}
type IElapsedTimeInfos ¶
type IElapsedTimeInfos interface { AddInfo(key string, info string) Dump(logger interface{}) SetElapsedTime(elapsedTime int64) GetElapsedTime() int64 }
func GetElapsedInfo ¶
func GetElapsedInfo() IElapsedTimeInfos
type MockDynamicConfig ¶
type MockDynamicConfig struct { }
func (MockDynamicConfig) GetEnableAnalyzer ¶
func (c MockDynamicConfig) GetEnableAnalyzer() bool
type StatisticsCell ¶
type StatisticsCell interface { StartTiming() EndTiming(tag string) }
type Summary ¶
type Summary struct {
// contains filtered or unexported fields
}
func GetTraceSummary ¶
func GetTraceSummary() *Summary
func NewSummary ¶
func NewSummary() *Summary
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func (*Tracer) EnableSummary ¶
func (t *Tracer) EnableSummary()
func (*Tracer) FormatRepeatingPins ¶
func (*Tracer) GetElapsedTime ¶
func (*Tracer) RepeatingPin ¶
func (*Tracer) SetWorkloadStatistic ¶
func (t *Tracer) SetWorkloadStatistic(wls *WorkloadStatistic)
type WorkloadStatistic ¶
type WorkloadStatistic struct {
// contains filtered or unexported fields
}
WorkloadStatistic accumulate workload for specific trace tags during some specific period. Everytime `Add` or `end` method be called, it record workload on corresponding `summaries` fields, and send this workload info to `shrinkLoop`, which will subtract this workload from `summaries` when the workload out of statistic period. To do that, `shrinkLoop` will record the workload and it's out-of-date timestamp; `shrinkLoop` also has a ticker promote current time once a second. If current time is larger or equal than recorded timestamp, it remove that workload and subtract it's value from `summaries`.
func GetApplyBlockWorkloadSttistic ¶
func GetApplyBlockWorkloadSttistic() *WorkloadStatistic
GetApplyBlockWorkloadSttistic return a global `WorkloadStatistic` object. WARNING: if you call `WorkloadStatistic.Add` concurrently, the summary result will be incorrect.
func (*WorkloadStatistic) Add ¶
Add accumulate workload to summary. WARNING: if you call `Add` concurrently, the summary result will be incorrect.
func (*WorkloadStatistic) Format ¶
func (ws *WorkloadStatistic) Format() string