collector

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Level2Lookup = SeedPub
	NewLookup    = SeedPrv
)
View Source
const (
	DefaultAPIEndpoint       = "127.0.0.1:4201"
	DefaultAdminEndpoint     = "127.0.0.1:4301"
	DefaultWebsocketEndpoint = "127.0.0.1:4401"
)

Variables

This section is empty.

Functions

func GetNodeIndexFromCmdline

func GetNodeIndexFromCmdline(cmdline []string) (int, error)

func GetNodeTypeFromCmdline

func GetNodeTypeFromCmdline(cmdline []string) string

func GetParamValueFromCmdline

func GetParamValueFromCmdline(cmdline []string, param ...string) string

func GetPortFromCmdline added in v0.0.8

func GetPortFromCmdline(cmdline []string) (int, error)

func GetProcesses added in v0.0.8

func GetProcesses(name string, port ...uint32) ([]*process.Process, error)

match port first, if no matched, return procs that matches name

func GetSyncTypeFromCmdline

func GetSyncTypeFromCmdline(cmdline []string) (int, error)

func GetZilliqaMainProcess added in v0.0.8

func GetZilliqaMainProcess(constants *Constants) *process.Process

func GetZilliqadProcess added in v0.0.8

func GetZilliqadProcess() *process.Process

func IsGeneralLookup added in v0.0.8

func IsGeneralLookup(nt NodeType) bool

Types

type APICollector

type APICollector struct {
	// contains filtered or unexported fields
}

collect instant values

func NewAPICollector

func NewAPICollector(constants *Constants) *APICollector

func (*APICollector) Collect

func (c *APICollector) Collect(ch chan<- prometheus.Metric)

func (*APICollector) Describe

func (c *APICollector) Describe(ch chan<- *prometheus.Desc)

type AdminCollector

type AdminCollector struct {
	// contains filtered or unexported fields
}

collect instant values

func NewAdminCollector

func NewAdminCollector(constants *Constants) *AdminCollector

func (*AdminCollector) Collect

func (c *AdminCollector) Collect(ch chan<- prometheus.Metric)

func (*AdminCollector) Describe

func (c *AdminCollector) Describe(ch chan<- *prometheus.Desc)

type Constants

type Constants struct {

	// k8s
	PodName     string
	PodIP       string
	Namespace   string
	NodeName    string
	NetworkName string

	// aws & testnet & genet
	Placement      string
	ClusterName    string
	PublicIP       string
	PublicHostname string
	LocalIP        string
	LocalHostname  string
	InstanceID     string
	InstanceType   string

	// zilliqa binary
	BinPath string
	Version string
	Commit  string

	// Desc
	NodeInfo *prometheus.Desc
	// contains filtered or unexported fields
}

func NewConstants added in v0.0.8

func NewConstants(options *Options) *Constants

func (*Constants) Collect added in v0.0.8

func (c *Constants) Collect(ch chan<- prometheus.Metric)

func (*Constants) CommonLabelValues added in v0.0.8

func (c *Constants) CommonLabelValues() []string

func (*Constants) CommonLabels added in v0.0.8

func (c *Constants) CommonLabels() []string

func (*Constants) Describe added in v0.0.8

func (c *Constants) Describe(ch chan<- *prometheus.Desc)

func (*Constants) NodeType added in v0.0.8

func (c *Constants) NodeType() NodeType

func (*Constants) P2PPort added in v0.0.8

func (c *Constants) P2PPort() uint32

func (*Constants) ShortPodName added in v0.0.15

func (c *Constants) ShortPodName() string

func (*Constants) StartWatch added in v0.0.8

func (c *Constants) StartWatch()

func (*Constants) StopWatch added in v0.0.8

func (c *Constants) StopWatch()

type NodeType

type NodeType int
const (
	UnknownNodeType NodeType = iota
	Lookup
	Seed    // dedicated seeds
	SeedPub // guard seeds that exposes api to public
	SeedPrv // guard seeds that exposes api to some specific client
	Normal
	DSGuard
)

func NodeTypeFromString

func NodeTypeFromString(typ string) NodeType

func (NodeType) String

func (n NodeType) String() string

type Options

type Options struct {
	IsMainNet bool

	NotCollectAPI         bool
	NotCollectAdmin       bool
	NotCollectWebsocket   bool
	NotCollectProcessInfo bool
	// contains filtered or unexported fields
}

func (Options) APIAddr added in v0.0.17

func (c Options) APIAddr() string

func (Options) APIEndpoint

func (c Options) APIEndpoint() string

func (Options) AdminEndpoint

func (c Options) AdminEndpoint() string

func (*Options) BindFlags

func (c *Options) BindFlags(set *pflag.FlagSet)

func (Options) GetAPIClient

func (c Options) GetAPIClient() *provider.Provider

func (Options) GetAdminClient

func (c Options) GetAdminClient() *adminclient.Client

func (*Options) MarshalJSON

func (c *Options) MarshalJSON() ([]byte, error)

func (*Options) ToMap

func (c *Options) ToMap() map[string]interface{}

func (Options) WebsocketEndpoint

func (c Options) WebsocketEndpoint() string

func (*Options) ZilliqaBinPath

func (c *Options) ZilliqaBinPath() string

type ProcessInfoCollector

type ProcessInfoCollector struct {
	// contains filtered or unexported fields
}

func NewProcessInfoCollector

func NewProcessInfoCollector(constants *Constants) *ProcessInfoCollector

func (*ProcessInfoCollector) Collect

func (c *ProcessInfoCollector) Collect(ch chan<- prometheus.Metric)

func (*ProcessInfoCollector) Describe

func (c *ProcessInfoCollector) Describe(ch chan<- *prometheus.Desc)

type ScheduleTask

type ScheduleTask struct {
	// contains filtered or unexported fields
}

type ScheduledCollector

type ScheduledCollector struct {

	// TODO: persistence-check
	UDStateSize    prometheus.Gauge
	UDStateEntries prometheus.Gauge
	// contains filtered or unexported fields
}

some

func NewScheduledCollector

func NewScheduledCollector(option *Options, constants *Constants) *ScheduledCollector

func (*ScheduledCollector) CollectGetUDContractStateSizeRecords

func (s *ScheduledCollector) CollectGetUDContractStateSizeRecords()

func (*ScheduledCollector) GetUDContractStateSizeRecords

func (s *ScheduledCollector) GetUDContractStateSizeRecords() (int, int, error)

func (*ScheduledCollector) Init

func (s *ScheduledCollector) Init(register prometheus.Registerer)

func (*ScheduledCollector) Start

func (s *ScheduledCollector) Start()

func (*ScheduledCollector) Stop

func (s *ScheduledCollector) Stop()

type SyncType

type SyncType int
const (
	DefaultSyncType SyncType = iota
	NewSyncType
	NormalSyncType
	DSSyncType
	LookupSyncType
	RecoverySyncType
	NewLookupSyncType
	DSGuardNodeSyncSyncType
	OfflineDBValidationSyncType
)

Jump to

Keyboard shortcuts

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