Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructNotifyMapKey(names ...string) string
- func ConstructUniqueTxKey(names ...string) string
- func CreateDir(directory string) error
- func DockerVMMessageFromPool() *protogo.DockerVMMessage
- func EnterNextStep(msg *protogo.DockerVMMessage, stepType protogo.StepType, getStr func() string)
- func Exists(path string) (bool, error)
- func GetMaxConnectionFromConfig(config *config.DockerVMConfig) uint32
- func GetMaxRecvMsgSizeFromConfig(conf *config.DockerVMConfig) uint32
- func GetMaxSendMsgSizeFromConfig(conf *config.DockerVMConfig) uint32
- func PrintTxSteps(msg *protogo.DockerVMMessage) string
- func PrintTxStepsWithTime(msg *protogo.DockerVMMessage) (string, bool)
- func ReturnToPool(m *protogo.DockerVMMessage)
- func SplitContractName(contractNameAndVersion string) string
- type BlockTxsDuration
- type BlockTxsDurationMgr
- func (r *BlockTxsDurationMgr) AddBlockTxsDuration(id string)
- func (r *BlockTxsDurationMgr) AddCrossTx(id string, txTime *TxDuration)
- func (r *BlockTxsDurationMgr) AddTx(id string, txTime *TxDuration)
- func (r *BlockTxsDurationMgr) FinishTx(id string, txTime *TxDuration)
- func (r *BlockTxsDurationMgr) PrintAllBlockTxsDuration(id string) string
- func (r *BlockTxsDurationMgr) PrintBlockTxsDuration(id string) string
- func (r *BlockTxsDurationMgr) PrintDetailBlockTxsDuration(id string)
- func (r *BlockTxsDurationMgr) RemoveBlockTxsDuration(id string)
- type SysCallDuration
- type TxDuration
- func (e *TxDuration) Add(txDuration *TxDuration)
- func (e *TxDuration) AddCrossDuration(duration *TxDuration)
- func (e *TxDuration) AddLatestStorageDuration(duration int64) error
- func (e *TxDuration) EndSysCall(msg *protogo.DockerVMMessage) error
- func (e *TxDuration) GetCurrDuration() *TxDuration
- func (e *TxDuration) GetLatestSysCall() (*SysCallDuration, error)
- func (e *TxDuration) PrintSysCallList() string
- func (e *TxDuration) StartSysCall(msgType protogo.DockerVMType) *SysCallDuration
- func (e *TxDuration) ToString() string
Constants ¶
const (
// DefaultMaxConnection is default max connection number
DefaultMaxConnection = 1
)
Variables ¶
var ( // ErrDuplicateTxId is the duplicate tx id err ErrDuplicateTxId = errors.New("duplicate txId") // ErrMissingByteCode is the missing bytecode err ErrMissingByteCode = errors.New("missing bytecode") // ErrClientReachLimit is the client limit err ErrClientReachLimit = errors.New("clients reach limit") )
Functions ¶
func ConstructNotifyMapKey ¶
ConstructNotifyMapKey chainId#txId
func ConstructUniqueTxKey ¶ added in v2.3.1
ConstructUniqueTxKey txId#count
func DockerVMMessageFromPool ¶ added in v2.3.2
func DockerVMMessageFromPool() *protogo.DockerVMMessage
DockerVMMessageFromPool get pb msg from pool
func EnterNextStep ¶
func EnterNextStep(msg *protogo.DockerVMMessage, stepType protogo.StepType, getStr func() string)
EnterNextStep enter next duration tx step
func Exists ¶
Exists returns whether the given file or directory exists
func GetMaxConnectionFromConfig ¶
func GetMaxConnectionFromConfig(config *config.DockerVMConfig) uint32
GetMaxConnectionFromConfig returns max connections from config
func GetMaxRecvMsgSizeFromConfig ¶
func GetMaxRecvMsgSizeFromConfig(conf *config.DockerVMConfig) uint32
GetMaxRecvMsgSizeFromConfig returns max recv msg size from config
func GetMaxSendMsgSizeFromConfig ¶
func GetMaxSendMsgSizeFromConfig(conf *config.DockerVMConfig) uint32
GetMaxSendMsgSizeFromConfig returns max send msg size from config
func PrintTxSteps ¶
func PrintTxSteps(msg *protogo.DockerVMMessage) string
PrintTxSteps print all duration tx steps
func PrintTxStepsWithTime ¶
func PrintTxStepsWithTime(msg *protogo.DockerVMMessage) (string, bool)
PrintTxStepsWithTime print all duration tx steps with time limt
func ReturnToPool ¶ added in v2.3.2
func ReturnToPool(m *protogo.DockerVMMessage)
ReturnToPool return pb msg to pool
Types ¶
type BlockTxsDuration ¶
type BlockTxsDuration struct {
// contains filtered or unexported fields
}
BlockTxsDuration record the duration of all transactions in a block
type BlockTxsDurationMgr ¶
type BlockTxsDurationMgr struct {
// contains filtered or unexported fields
}
BlockTxsDurationMgr record the txDuration of each block
func NewBlockTxsDurationMgr ¶
func NewBlockTxsDurationMgr(logger protocol.Logger) *BlockTxsDurationMgr
NewBlockTxsDurationMgr construct a BlockTxsDurationMgr
func (*BlockTxsDurationMgr) AddBlockTxsDuration ¶
func (r *BlockTxsDurationMgr) AddBlockTxsDuration(id string)
AddBlockTxsDuration .
func (*BlockTxsDurationMgr) AddCrossTx ¶ added in v2.3.5
func (r *BlockTxsDurationMgr) AddCrossTx(id string, txTime *TxDuration)
AddCrossTx add cross tx to block map need lock
func (*BlockTxsDurationMgr) AddTx ¶
func (r *BlockTxsDurationMgr) AddTx(id string, txTime *TxDuration)
AddTx if add tx to block map need lock
func (*BlockTxsDurationMgr) FinishTx ¶
func (r *BlockTxsDurationMgr) FinishTx(id string, txTime *TxDuration)
FinishTx .
func (*BlockTxsDurationMgr) PrintAllBlockTxsDuration ¶ added in v2.3.5
func (r *BlockTxsDurationMgr) PrintAllBlockTxsDuration(id string) string
PrintAllBlockTxsDuration returns the duration of the specified block
func (*BlockTxsDurationMgr) PrintBlockTxsDuration ¶
func (r *BlockTxsDurationMgr) PrintBlockTxsDuration(id string) string
PrintBlockTxsDuration returns the duration of the specified block
func (*BlockTxsDurationMgr) PrintDetailBlockTxsDuration ¶ added in v2.3.5
func (r *BlockTxsDurationMgr) PrintDetailBlockTxsDuration(id string)
PrintDetailBlockTxsDuration returns the duration of the specified block
func (*BlockTxsDurationMgr) RemoveBlockTxsDuration ¶
func (r *BlockTxsDurationMgr) RemoveBlockTxsDuration(id string)
RemoveBlockTxsDuration .
type SysCallDuration ¶
type SysCallDuration struct { OpType protogo.DockerVMType StartTime int64 TotalDuration int64 StorageDuration int64 }
SysCallDuration .
func NewSysCallDuration ¶
func NewSysCallDuration(opType protogo.DockerVMType, startTime int64, totalTime int64, storageTime int64) *SysCallDuration
NewSysCallDuration construct a SysCallDuration
func (*SysCallDuration) AddStorageDuration ¶ added in v2.3.5
func (s *SysCallDuration) AddStorageDuration(nanos int64)
AddStorageDuration .
type TxDuration ¶
type TxDuration struct { OriginalTxId string TxId string StartTime int64 EndTime int64 TotalDuration int64 SysCallCnt int32 SysCallDuration int64 StorageDuration int64 LoadContractSysCallCnt int32 LoadContractSysCallDuration int64 CrossCallCnt int32 CrossCallDuration int64 SysCallList []*SysCallDuration CrossCallList []*TxDuration CurrDurationStack *list.List }
TxDuration .
func NewTxDuration ¶
func NewTxDuration(originalTxId, txId string, startTime int64) *TxDuration
NewTxDuration .
func (*TxDuration) Add ¶
func (e *TxDuration) Add(txDuration *TxDuration)
Add the param txDuration to self just add the root duration, the duration of child nodes will be synchronized to the root node at the end of statistics
func (*TxDuration) AddCrossDuration ¶ added in v2.3.5
func (e *TxDuration) AddCrossDuration(duration *TxDuration)
AddCrossDuration start new sys call
func (*TxDuration) AddLatestStorageDuration ¶
func (e *TxDuration) AddLatestStorageDuration(duration int64) error
AddLatestStorageDuration add storage time to latest sys call
func (*TxDuration) EndSysCall ¶
func (e *TxDuration) EndSysCall(msg *protogo.DockerVMMessage) error
EndSysCall close new sys call
func (*TxDuration) GetCurrDuration ¶ added in v2.3.5
func (e *TxDuration) GetCurrDuration() *TxDuration
GetCurrDuration get current duration
func (*TxDuration) GetLatestSysCall ¶
func (e *TxDuration) GetLatestSysCall() (*SysCallDuration, error)
GetLatestSysCall returns latest sys call
func (*TxDuration) PrintSysCallList ¶
func (e *TxDuration) PrintSysCallList() string
PrintSysCallList print tx duration
func (*TxDuration) StartSysCall ¶
func (e *TxDuration) StartSysCall(msgType protogo.DockerVMType) *SysCallDuration
StartSysCall start new sys call