diagnostics

package
v0.0.0-...-ff78b6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context[I Info](ctx context.Context, buffer int) (context.Context, <-chan I, context.CancelFunc)

func RegisterProvider

func RegisterProvider(provider Provider, infoType Type, logger log.Logger)

func Send

func Send[I Info](info I) error

func StartProviders

func StartProviders(ctx context.Context, infoType Type, logger log.Logger)

Types

type DownloadStatistics

type DownloadStatistics struct {
	Downloaded       uint64  `json:"downloaded"`
	Total            uint64  `json:"total"`
	TotalTime        float64 `json:"totalTime"`
	DownloadRate     uint64  `json:"downloadRate"`
	UploadRate       uint64  `json:"uploadRate"`
	Peers            int32   `json:"peers"`
	Files            int32   `json:"files"`
	Connections      uint64  `json:"connections"`
	Alloc            uint64  `json:"alloc"`
	Sys              uint64  `json:"sys"`
	DownloadFinished bool    `json:"downloadFinished"`
	StagePrefix      string  `json:"stagePrefix"`
}

func (DownloadStatistics) Type

func (ti DownloadStatistics) Type() Type

type Info

type Info interface {
	Type() Type
}

type PeerStatistics

type PeerStatistics struct {
	BytesIn      uint64
	BytesOut     uint64
	CapBytesIn   map[string]uint64
	CapBytesOut  map[string]uint64
	TypeBytesIn  map[string]uint64
	TypeBytesOut map[string]uint64
}

func (PeerStatistics) Type

func (p PeerStatistics) Type() Type

type PeerStatisticsGetter

type PeerStatisticsGetter interface {
	GetPeersStatistics() map[string]*PeerStatistics
}

type Provider

type Provider interface {
	StartDiagnostics(ctx context.Context) error
}

type ProviderFunc

type ProviderFunc func(ctx context.Context) error

func (ProviderFunc) StartDiagnostics

func (f ProviderFunc) StartDiagnostics(ctx context.Context) error

type Type

type Type interface {
	reflect.Type
	Context() context.Context
	Err() error
}

func TypeOf

func TypeOf(i Info) Type

Jump to

Keyboard shortcuts

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