diagnostics

package
v0.0.0-...-1f8a15b Latest Latest
Warning

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

Go to latest
Published: Dec 12, 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 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 SegmentDownloadStatistics

type SegmentDownloadStatistics struct {
	Name            string `json:"name"`
	TotalBytes      uint64 `json:"totalBytes"`
	DownloadedBytes uint64 `json:"downloadedBytes"`
	WebseedsCount   int    `json:"webseedsCount"`
	PeersCount      int    `json:"peersCount"`
	WebseedsRate    uint64 `json:"webseedsRate"`
	PeersRate       uint64 `json:"peersRate"`
}

func (SegmentDownloadStatistics) Type

func (ti SegmentDownloadStatistics) Type() Type

type SnapshotDownloadStatistics

type SnapshotDownloadStatistics 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"`
	Segments         map[string]SegmentDownloadStatistics `json:"segments"`
}

func (SnapshotDownloadStatistics) Type

func (ti SnapshotDownloadStatistics) Type() Type

type Type

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

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