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) AddTx(id string, txTime *TxDuration)
- func (r *BlockTxsDurationMgr) FinishTx(id string, txTime *TxDuration)
- func (r *BlockTxsDurationMgr) PrintBlockTxsDuration(id string) string
- func (r *BlockTxsDurationMgr) RemoveBlockTxsDuration(id string)
- type SysCallDuration
- type TxDuration
- func (e *TxDuration) Add(txDuration *TxDuration)
- func (e *TxDuration) AddContingentSysCall(spend int64)
- func (e *TxDuration) AddLatestStorageDuration(duration int64) error
- func (e *TxDuration) EndSysCall(msg *protogo.DockerVMMessage) error
- func (e *TxDuration) GetLatestSysCall() (*SysCallDuration, error)
- func (e *TxDuration) PrintSysCallList() string
- func (e *TxDuration) Seal()
- func (e *TxDuration) StartSysCall(msgType protogo.DockerVMType)
- 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 ¶
ConstructUniqueTxKey txId#count
func DockerVMMessageFromPool ¶
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 ¶
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
func (*BlockTxsDuration) AddTxDuration ¶
func (b *BlockTxsDuration) AddTxDuration(t *TxDuration)
AddTxDuration add a TxDuration
func (*BlockTxsDuration) FinishTxDuration ¶
func (b *BlockTxsDuration) FinishTxDuration(t *TxDuration)
FinishTxDuration end time statistics
type BlockTxsDurationMgr ¶
type BlockTxsDurationMgr struct {
// contains filtered or unexported fields
}
BlockTxsDurationMgr record the txDuration of each block
func NewBlockTxsDurationMgr ¶
func NewBlockTxsDurationMgr() *BlockTxsDurationMgr
NewBlockTxsDurationMgr construct a BlockTxsDurationMgr
func (*BlockTxsDurationMgr) AddBlockTxsDuration ¶
func (r *BlockTxsDurationMgr) AddBlockTxsDuration(id string)
AddBlockTxsDuration .
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) PrintBlockTxsDuration ¶
func (r *BlockTxsDurationMgr) PrintBlockTxsDuration(id string) string
PrintBlockTxsDuration 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
type TxDuration ¶
type TxDuration struct { OriginalTxId string TxId string StartTime int64 EndTime int64 TotalDuration int64 SysCallCnt int32 SysCallDuration int64 StorageDuration int64 ContingentSysCallCnt int32 ContingentSysCallDuration int64 CrossCallCnt int32 CrossCallDuration int64 SysCallList []*SysCallDuration CrossCallList []*TxDuration Sealed bool }
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) AddContingentSysCall ¶
func (e *TxDuration) AddContingentSysCall(spend int64)
AddContingentSysCall add contingent syscall
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) 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) Seal ¶
func (e *TxDuration) Seal()
Seal the txDuration, The sealed node will no longer update its state and will not generate new cross contract calls at this node and its child nodes
func (*TxDuration) StartSysCall ¶
func (e *TxDuration) StartSysCall(msgType protogo.DockerVMType)
StartSysCall start new sys call