monitoring

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

ZooBC Copyright (C) 2020 Quasisoft Limited - Hong Kong This file is part of ZooBC <https://github.com/zoobc/zoobc-core>

ZooBC is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ZooBC 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with ZooBC. If not, see <http://www.gnu.org/licenses/>.

Additional Permission Under GNU GPL Version 3 section 7. As the special exception permitted under Section 7b, c and e, in respect with the Author’s copyright, please refer to this section:

  1. You are free to convey this Program according to GNU GPL Version 3, as long as you respect and comply with the Author’s copyright by showing in its user interface an Appropriate Notice that the derivate program and its source code are “powered by ZooBC”. This is an acknowledgement for the copyright holder, ZooBC, as the implementation of appreciation of the exclusive right of the creator and to avoid any circumvention on the rights under trademark law for use of some trade names, trademarks, or service marks.
  1. Complying to the GNU GPL Version 3, you may distribute the program without any permission from the Author. However a prior notification to the authors will be appreciated.

ZooBC is architected by Roberto Capodieci & Barton Johnston

contact us at roberto.capodieci[at]blockchainzoo.com
and barton.johnston[at]blockchainzoo.com

Core developers that contributed to the current implementation of the software are:

Ahmad Ali Abdilah ahmad.abdilah[at]blockchainzoo.com
Allan Bintoro allan.bintoro[at]blockchainzoo.com
Andy Herman
Gede Sukra
Ketut Ariasa
Nawi Kartini nawi.kartini[at]blockchainzoo.com
Stefano Galassi stefano.galassi[at]blockchainzoo.com

IMPORTANT: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Index

Constants

View Source
const (
	P2pGetPeerInfoServer                = "P2pGetPeerInfoServer"
	P2pGetMorePeersServer               = "P2pGetMorePeersServer"
	P2pSendPeersServer                  = "P2pSendPeersServer"
	P2pSendBlockServer                  = "P2pSendBlockServer"
	P2pSendTransactionServer            = "P2pSendTransactionServer"
	P2pRequestBlockTransactionsServer   = "P2pRequestBlockTransactionsServer"
	P2pGetCumulativeDifficultyServer    = "P2pGetCumulativeDifficultyServer"
	P2pGetCommonMilestoneBlockIDsServer = "P2pGetCommonMilestoneBlockIDsServer"
	P2pGetNextBlockIDsServer            = "P2pGetNextBlockIDsServer"
	P2pGetNextBlocksServer              = "P2pGetNextBlocksServer"
	P2pRequestFileDownloadServer        = "P2pRequestFileDownloadServer"
	P2pGetNodeProofOfOriginServer       = "P2pGetNodeProofOfOriginServer"

	P2pGetPeerInfoClient                 = "P2pGetPeerInfoClient"
	P2pGetMorePeersClient                = "P2pGetMorePeersClient"
	P2pSendPeersClient                   = "P2pSendPeersClient"
	P2pSendNodeAddressInfoClient         = "P2pSendNodeAddressInfoClient"
	P2pGetNodeProofOfOwnershipInfoClient = "P2pGetNodeProofOfOwnershipInfoClient"
	P2pSendBlockClient                   = "P2pSendBlockClient"
	P2pSendTransactionClient             = "P2pSendTransactionClient"
	P2pRequestBlockTransactionsClient    = "P2pRequestBlockTransactionsClient"
	P2pGetCumulativeDifficultyClient     = "P2pGetCumulativeDifficultyClient"
	P2pGetCommonMilestoneBlockIDsClient  = "P2pGetCommonMilestoneBlockIDsClient"
	P2pGetNextBlockIDsClient             = "P2pGetNextBlockIDsClient"
	P2pGetNextBlocksClient               = "P2pGetNextBlocksClient"
	P2pRequestFileDownloadClient         = "P2pRequestFileDownloadClient"
)
View Source
const (
	MigrationApplyOwnerProcess                   = 1
	AddGenesisNextNodeAdmissionOwnerProcess      = 2
	AddGenesisAccountOwnerProcess                = 3
	MainPushBlockOwnerProcess                    = 4
	SpinePushBlockOwnerProcess                   = 5
	SpinePopOffToBlockOwnerProcess               = 6
	BackupMempoolsOwnerProcess                   = 7
	ProcessMempoolLaterOwnerProcess              = 8
	PostTransactionServiceOwnerProcess           = 9
	RestoreMempoolsBackupOwnerProcess            = 10
	ReceivedTransactionOwnerProcess              = 11
	DeleteExpiredMempoolTransactionsOwnerProcess = 12
	InsertAddressInfoOwnerProcess                = 13
	UpdateAddrressInfoOwnerProcess               = 14
	ConfirmNodeAddressInfoOwnerProcess           = 15
	DeletePendingNodeAddressInfoOwnerProcess     = 16
	ExpiringPendingTransactionsOwnerProcess      = 17
	GenerateReceiptsMerkleRootOwnerProcess       = 18
	InsertSnapshotPayloadToDBOwnerProcess        = 19
	CreateSpineBlockManifestOwnerProcess         = 20
	ExpiringEscrowTransactionsOwnerProcess       = 21
)

Variables

View Source
var (
	CLIMonitoringResolvePeersNumber            = "ResolvePeersNumber"
	CLIMonitoringUnresolvedPeersNumber         = "UnresolvedPeersNumber"
	CLIMonitoringResolvedPriorityPeersNumber   = "ResolvedPriorityPeersNumber"
	CLIMonitoringUnresolvedPriorityPeersNumber = "UnresolvedPriorityPeersNumber"
)
View Source
var (
	P2PTxFilteredIncoming prometheus.Gauge
	P2PTxFilteredOutgoing prometheus.Gauge
)

Functions

func DecrementDbLockCounter

func DecrementDbLockCounter(priorityLock int)

func DecrementGoRoutineActivity

func DecrementGoRoutineActivity(activityName string)

func DecrementRunningAPIHandling

func DecrementRunningAPIHandling(apiName string)

func DecrementStatusLockCounter

func DecrementStatusLockCounter(chaintype chaintype.ChainType, typeStatusLock int)

func GetNodeStatus

func GetNodeStatus() model.GetNodeStatusResponse

func Handler

func Handler() http.Handler

func IncreaseP2PTxFilteredIncoming

func IncreaseP2PTxFilteredIncoming()

func IncreaseP2PTxFilteredOutgoing

func IncreaseP2PTxFilteredOutgoing()

func IncreaseTxFiltered

func IncreaseTxFiltered()

func IncreaseTxProcessed

func IncreaseTxProcessed()

func IncreaseTxReceived

func IncreaseTxReceived()

func IncrementBlockerMetrics

func IncrementBlockerMetrics(typeBlocker string)

func IncrementDbLockCounter

func IncrementDbLockCounter(priorityLock, processOwner int)

func IncrementGetAddressInfoTableFromPeer

func IncrementGetAddressInfoTableFromPeer()

func IncrementGoRoutineActivity

func IncrementGoRoutineActivity(activityName string)

func IncrementMainchainDownloadCycleDebugger

func IncrementMainchainDownloadCycleDebugger(chainType chaintype.ChainType, cycleMarker int)

func IncrementReceiptCounter

func IncrementReceiptCounter()

func IncrementRunningAPIHandling

func IncrementRunningAPIHandling(apiName string)

func IncrementSendAddressInfoToPeer

func IncrementSendAddressInfoToPeer()

func IncrementSnapshotDownloadCounter

func IncrementSnapshotDownloadCounter(succeeded, failed int32)

func IncrementStatusLockCounter

func IncrementStatusLockCounter(chaintype chaintype.ChainType, typeStatusLock int)

func IsMonitoringActive

func IsMonitoringActive() bool

func ResetMainchainDownloadCycleDebugger

func ResetMainchainDownloadCycleDebugger(chainType chaintype.ChainType)

func SetAPIResponseTime

func SetAPIResponseTime(apiName string, responseTime float64)

func SetActiveRegisteredNodesCount

func SetActiveRegisteredNodesCount(count int)

func SetBlockProcessTime

func SetBlockProcessTime(timeMs int64)

func SetBlockchainSmithIndex

func SetBlockchainSmithIndex(chainType chaintype.ChainType, index int64)

func SetBlockchainStatus

func SetBlockchainStatus(chainType chaintype.ChainType, newStatus int)

func SetCLIMonitoring

func SetCLIMonitoring(cliMonitoring CLIMonitoringInteface)

func SetCacheStorageMetrics

func SetCacheStorageMetrics(cacheType CacheStorageType, size float64)

func SetDatabaseStats

func SetDatabaseStats(dbStat sql.DBStats)

func SetDbLockBlockingOwner

func SetDbLockBlockingOwner(name string, processOwner int)

func SetLastBlock

func SetLastBlock(chainType chaintype.ChainType, block *model.Block)

func SetMempoolTransactionCount

func SetMempoolTransactionCount(mempoolTxCount int)

func SetMonitoringActive

func SetMonitoringActive(isActive bool)

func SetNextSmith

func SetNextSmith(sortedBlocksmiths []*model.Blocksmith, sortedBlocksmithsMap map[string]*int64)

func SetNodeAddressInfoCount

func SetNodeAddressInfoCount(count int)

func SetNodeAddressStatusCount

func SetNodeAddressStatusCount(count int, status model.NodeAddressStatus)

func SetNodePublicKey

func SetNodePublicKey(pk []byte)

func SetNodeScore

func SetNodeScore(score int64)

func SetResolvedPeersCount

func SetResolvedPeersCount(count int)

func SetResolvedPriorityPeersCount

func SetResolvedPriorityPeersCount(count int)

func SetTpsProcessed

func SetTpsProcessed(tps int)

func SetTpsReceived

func SetTpsReceived(tps int)

func SetUnresolvedPeersCount

func SetUnresolvedPeersCount(count int)

func SetUnresolvedPriorityPeersCount

func SetUnresolvedPriorityPeersCount(count int)

Types

type CLIMonitoring

type CLIMonitoring struct {
	ConfigInfo        *model.Config
	BlocksInfo        map[int32]*model.Block
	PeersInfo         map[string]int
	SmithInfo         *model.Blocksmith
	NextSmithingIndex *int64
	PeersInfoLock     sync.RWMutex
	BlocksInfoLock    sync.RWMutex
}

func (*CLIMonitoring) Start

func (cm *CLIMonitoring) Start()

func (*CLIMonitoring) UpdateBlockState

func (cm *CLIMonitoring) UpdateBlockState(chaintype chaintype.ChainType, block *model.Block)

func (*CLIMonitoring) UpdatePeersInfo

func (cm *CLIMonitoring) UpdatePeersInfo(peersType string, peersNumber int)

func (*CLIMonitoring) UpdateSmithingInfo

func (cm *CLIMonitoring) UpdateSmithingInfo(sortedBlocksmiths []*model.Blocksmith, sortedBlocksmithsMap map[string]*int64)

type CLIMonitoringInteface

type CLIMonitoringInteface interface {
	UpdateBlockState(chaintype chaintype.ChainType, block *model.Block)
	UpdatePeersInfo(peersType string, peersNumber int)
	UpdateSmithingInfo(sortedBlocksmiths []*model.Blocksmith, sortedBlocksmithsMap map[string]*int64)
	Start()
}

func NewCLIMonitoring

func NewCLIMonitoring(configInfo *model.Config) CLIMonitoringInteface

type CacheStorageType

type CacheStorageType string

CacheStorageType type of cache storage that needed for inc or dec the value

var (
	TypeMempoolCacheStorage         CacheStorageType = "mempools"
	TypeBatchReceiptCacheStorage    CacheStorageType = "batch_receipts"
	TypeScrambleNodeCacheStorage    CacheStorageType = "scramble_nodes"
	TypeMempoolBackupCacheStorage   CacheStorageType = "backup_mempools"
	TypeNodeShardCacheStorage       CacheStorageType = "node_shards"
	TypeNodeAddressInfoCacheStorage CacheStorageType = "node_address_infos"
	TypeActiveNodeRegistryStorage   CacheStorageType = "node_registry_active"
	TypePendingNodeRegistryStorage  CacheStorageType = "node_registry_pending"
	TypeMainBlocksCacheStorage      CacheStorageType = "main_blocks_cache_object"
	TypeSpineBlocksCacheStorage     CacheStorageType = "spine_blocks_cache_object"
)

Cache Storage environments Please add new one when add new cache storage instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL