Skip to content
Snippets Groups Projects
Unverified Commit da0bed9d authored by Levente Pap's avatar Levente Pap
Browse files

Fix linter warnings

parent 2aaf0570
No related branches found
No related tags found
No related merge requests found
......@@ -2,14 +2,14 @@ package dashboard
import (
"fmt"
"github.com/gorilla/websocket"
"time"
"github.com/gorilla/websocket"
"github.com/iotaledger/goshimmer/packages/shutdown"
analysisserver "github.com/iotaledger/goshimmer/plugins/analysis/server"
"github.com/iotaledger/hive.go/daemon"
"github.com/iotaledger/hive.go/events"
"github.com/iotaledger/hive.go/workerpool"
analysisserver "github.com/iotaledger/goshimmer/plugins/analysis/server"
)
var (
......@@ -103,7 +103,7 @@ func runAutopeeringFeed() {
autopeeringWorkerPool.Submit("c", source, target)
})
daemon.BackgroundWorker("Analysis-Dashboard[AutopeeringVisualizer]", func(shutdownSignal <-chan struct{}) {
if err := daemon.BackgroundWorker("Analysis-Dashboard[AutopeeringVisualizer]", func(shutdownSignal <-chan struct{}) {
// connect closures (submitting tasks) to events of the analysis server
analysisserver.Events.AddNode.Attach(notifyAddNode)
defer analysisserver.Events.AddNode.Detach(notifyAddNode)
......@@ -118,7 +118,9 @@ func runAutopeeringFeed() {
log.Info("Stopping Analysis-Dashboard[AutopeeringVisualizer] ...")
autopeeringWorkerPool.Stop()
log.Info("Stopping Analysis-Dashboard[AutopeeringVisualizer] ... done")
}, shutdown.PriorityDashboard)
}, shutdown.PriorityDashboard); err != nil {
panic(err)
}
}
// creates event handlers for replaying autopeering events on them
......
......@@ -17,8 +17,6 @@ var (
fpcLiveFeedWorkerCount = 1
fpcLiveFeedWorkerQueueSize = 50
fpcLiveFeedWorkerPool *workerpool.WorkerPool
conflicts map[string]Conflict
)
// Conflict defines the struct for the opinions of the nodes regarding a given conflict.
......@@ -48,7 +46,7 @@ func configureFPCLiveFeed() {
}
func runFPCLiveFeed() {
daemon.BackgroundWorker("Analysis[FPCUpdater]", func(shutdownSignal <-chan struct{}) {
if err := daemon.BackgroundWorker("Analysis[FPCUpdater]", func(shutdownSignal <-chan struct{}) {
newMsgRateLimiter := time.NewTicker(time.Second / 10)
defer newMsgRateLimiter.Stop()
......@@ -68,7 +66,9 @@ func runFPCLiveFeed() {
log.Info("Stopping Analysis[FPCUpdater] ...")
analysis.Events.FPCHeartbeat.Detach(onFPCHeartbeatReceived)
log.Info("Stopping Analysis[FPCUpdater] ... done")
}, shutdown.PriorityDashboard)
}, shutdown.PriorityDashboard); err != nil {
panic(err)
}
}
func createFPCUpdate(hb *packet.FPCHeartbeat) *FPCMsg {
......
......@@ -24,8 +24,6 @@ var (
log *logger.Logger
server *echo.Echo
nodeStartAt = time.Now()
)
func configure(plugin *node.Plugin) {
......@@ -108,4 +106,3 @@ func worker(shutdownSignal <-chan struct{}) {
log.Errorf("Error stopping: %s", err)
}
}
package dashboard
import (
"github.com/mr-tron/base58"
"strings"
"sync"
"time"
......@@ -11,6 +10,7 @@ import (
analysisserver "github.com/iotaledger/goshimmer/plugins/analysis/server"
"github.com/iotaledger/hive.go/daemon"
"github.com/iotaledger/hive.go/events"
"github.com/mr-tron/base58"
)
// the period in which we scan and delete old data.
......
package dashboard
const (
// MsgTypePing defines a ping message type.
MsgTypePing byte = iota
// MsgTypeFPC defines a FPC update message.
MsgTypeFPC
......@@ -18,37 +19,3 @@ type wsmsg struct {
Type byte `json:"type"`
Data interface{} `json:"data"`
}
type msg struct {
ID string `json:"id"`
Value int64 `json:"value"`
}
type nodestatus struct {
ID string `json:"id"`
Version string `json:"version"`
Uptime int64 `json:"uptime"`
Mem *memmetrics `json:"mem"`
}
type memmetrics struct {
Sys uint64 `json:"sys"`
HeapSys uint64 `json:"heap_sys"`
HeapInuse uint64 `json:"heap_inuse"`
HeapIdle uint64 `json:"heap_idle"`
HeapReleased uint64 `json:"heap_released"`
HeapObjects uint64 `json:"heap_objects"`
MSpanInuse uint64 `json:"m_span_inuse"`
MCacheInuse uint64 `json:"m_cache_inuse"`
StackSys uint64 `json:"stack_sys"`
NumGC uint32 `json:"num_gc"`
LastPauseGC uint64 `json:"last_pause_gc"`
}
type neighbormetric struct {
ID string `json:"id"`
Address string `json:"address"`
ConnectionOrigin string `json:"connection_origin"`
BytesRead uint32 `json:"bytes_read"`
BytesWritten uint32 `json:"bytes_written"`
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment