Skip to content
Snippets Groups Projects
Select Git revision
  • 32ed993ae51e150fb7d5da78adb861d7e968b543
  • without_tipselection default
  • develop protected
  • fix/grafana-local-dashboard
  • wasp
  • fix/dashboard-explorer-freeze
  • master
  • feat/timerqueue
  • test/sync_debug_and_650
  • feat/sync_revamp_inv
  • wip/sync
  • tool/db-recovery
  • portcheck/fix
  • fix/synchronization
  • feat/new-dashboard-analysis
  • feat/refactored-analysis-dashboard
  • feat/new-analysis-dashboard
  • test/demo-prometheus-fpc
  • prometheus_metrics
  • wip/analysis-server
  • merge/fpc-test-value-transfer
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.3
  • v0.1.2
  • v0.1.1
  • v0.1.0
28 results

events.go

Blame
  • user avatar
    Luca Moser authored and GitHub committed
    * fixes typos
    
    * lets make the dog shut up
    8bd01e40
    History
    events.go 2.99 KiB
    package metrics
    
    import (
    	"github.com/iotaledger/goshimmer/packages/vote"
    	"github.com/iotaledger/hive.go/events"
    )
    
    // CollectionEvents defines the events fot the metrics package.
    type CollectionEvents struct {
    	// AnalysisOutboundBytes defines the local analysis outbound network traffic in bytes.
    	AnalysisOutboundBytes *events.Event
    	// FPCInboundBytes defines the local FPC inbound network traffic in bytes.
    	FPCInboundBytes *events.Event
    	// FPCOutboundBytes defines the local FPC outbound network traffic in bytes.
    	FPCOutboundBytes *events.Event
    	// CPUUsage defines the local CPU usage.
    	CPUUsage *events.Event
    	// MemUsage defines the local GoShimmer memory usage.
    	MemUsage *events.Event
    	// Synced defines the local sync status event.
    	Synced *events.Event
    	// ValueTips defines the local value tips count event.
    	ValueTips *events.Event
    	// MessageTips defines the local message tips count event.
    	MessageTips *events.Event
    	// QueryReceived defines the local FPC query received event.
    	QueryReceived *events.Event
    	// QueryReplyError defines the local FPC query finalization event.
    	QueryReplyError *events.Event
    	// AnalysisFPCFinalized defines the global FPC finalization event.
    	AnalysisFPCFinalized *events.Event
    }
    
    // QueryReceivedEvent is used to pass information through a QueryReceived event.
    type QueryReceivedEvent struct {
    	// OpinionCount defines the local FPC number of opinions requested within a received query.
    	OpinionCount int
    }
    
    // QueryReplyErrorEvent is used to pass information through a QueryReplyError event.
    type QueryReplyErrorEvent struct {
    	// ID defines the ID on the queried node.
    	ID string
    	// OpinionCount defines the local FPC number of opinions requested within a failed query.
    	OpinionCount int
    }
    
    // AnalysisFPCFinalizedEvent is triggered by the analysis-server to
    // notify a finalized FPC vote from one node.
    type AnalysisFPCFinalizedEvent struct {
    	// ConflictID defines the ID of the finalized conflict.
    	ConflictID string
    	// NodeID defines the ID of the node.
    	NodeID string
    	// Rounds defines the number of rounds performed to finalize.
    	Rounds int
    	// Opinions contains the opinion of each round.
    	Opinions []vote.Opinion
    	// Outcome defines the outcome of the FPC voting.
    	Outcome vote.Opinion
    }
    
    func queryReceivedEventCaller(handler interface{}, params ...interface{}) {
    	handler.(func(ev *QueryReceivedEvent))(params[0].(*QueryReceivedEvent))
    }
    
    func queryReplyErrorEventCaller(handler interface{}, params ...interface{}) {
    	handler.(func(ev *QueryReplyErrorEvent))(params[0].(*QueryReplyErrorEvent))
    }
    
    func uint64Caller(handler interface{}, params ...interface{}) {
    	handler.(func(uint64))(params[0].(uint64))
    }
    
    func float64Caller(handler interface{}, params ...interface{}) {
    	handler.(func(float64))(params[0].(float64))
    }
    
    func boolCaller(handler interface{}, params ...interface{}) {
    	handler.(func(bool))(params[0].(bool))
    }
    
    func fpcFinalizedEventCaller(handler interface{}, params ...interface{}) {
    	handler.(func(ev *AnalysisFPCFinalizedEvent))(params[0].(*AnalysisFPCFinalizedEvent))
    }