stats

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HostStatStorePrefix = "/host_stats/" // from btfs-hub
)

Variables

View Source
var StorageStatsCmd = &cmds.Command{
	Helptext: cmds.HelpText{
		Tagline: "Get node storage stats.",
		ShortDescription: `
This command get node storage stats in the network.`,
	},
	Subcommands: map[string]*cmds.Command{
		"sync": storageStatsSyncCmd,
		"info": storageStatsInfoCmd,
		"list": storageStatsListCmd,
	},
}

Storage Stats

Includes sub-commands: info, sync

Functions

func GetHostStatStorageKey

func GetHostStatStorageKey(pid string) ds.Key

func GetHostStatStorageKeyWithTimestamp

func GetHostStatStorageKeyWithTimestamp(pid string) ds.Key

func GetHostStatsFromDatastore

func GetHostStatsFromDatastore(ctx context.Context, node *core.IpfsNode, nodeId string) (*nodepb.StorageStat_Host, error)

GetHostStatsFromDatastore retrieves host storage stats based on node id

func SaveHostStatsIntoDatastore

func SaveHostStatsIntoDatastore(ctx context.Context, node *core.IpfsNode, nodeId string,
	stats *nodepb.StorageStat_Host) error

SaveHostStatsIntoDatastore overwrites host storage stats based on node id

func SyncStats

func SyncStats(ctx context.Context, cfg *config.Config, node *core.IpfsNode, env cmds.Environment) error

Types

type Stat_HostWithTimeStamp

type Stat_HostWithTimeStamp struct {
	Stat      nodepb.StorageStat_Host `json:"stat"`
	Timestamp int64                   `json:"timestamp"`
}

func ListHostStatsFromDatastore

func ListHostStatsFromDatastore(ctx context.Context, node *core.IpfsNode, nodeId string, from int64, to int64) ([]*Stat_HostWithTimeStamp, error)

ListHostStatsFromDatastore retrieves host storage stats based on node id

Jump to

Keyboard shortcuts

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