diagnostics

package
v0.0.0-...-e4696f9 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2014 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

package diagnostics implements a network diagnostics service that allows a request to traverse the network and gather information on every node connected to it.

Index

Constants

View Source
const ResponseTimeout = time.Second * 10

Variables

This section is empty.

Functions

func GetGraphJson

func GetGraphJson(dinfo []*DiagInfo) []byte

Types

type DiagInfo

type DiagInfo struct {
	// This nodes ID
	ID string

	// A list of peers this node currently has open connections to
	Connections []connDiagInfo

	// A list of keys provided by this node
	//    (currently not filled)
	Keys []string

	// How long this node has been running for
	// TODO rename Uptime
	LifeSpan time.Duration

	// Incoming Bandwidth Usage
	BwIn uint64

	// Outgoing Bandwidth Usage
	BwOut uint64

	// Information about the version of code this node is running
	CodeVersion string
}

func (*DiagInfo) Marshal

func (di *DiagInfo) Marshal() []byte

Marshal to json

type Diagnostics

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

Diagnostics is a net service that manages requesting and responding to diagnostic requests

func NewDiagnostics

func NewDiagnostics(self peer.Peer, inet net.Network, sender net.Sender) *Diagnostics

NewDiagnostics instantiates a new diagnostics service running on the given network

func (*Diagnostics) GetDiagnostic

func (d *Diagnostics) GetDiagnostic(timeout time.Duration) ([]*DiagInfo, error)

GetDiagnostic runs a diagnostics request across the entire network

func (*Diagnostics) HandleMessage

func (d *Diagnostics) HandleMessage(ctx context.Context, mes msg.NetMessage) msg.NetMessage

Directories

Path Synopsis
internal
pb
Package diagnostics_pb is a generated protocol buffer package.
Package diagnostics_pb is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳