Documentation ¶
Index ¶
- Constants
- Variables
- func GetHostStatStorageKey(pid string) ds.Key
- func GetHostStatStorageKeyWithTimestamp(pid string) ds.Key
- func GetHostStatsFromDatastore(ctx context.Context, node *core.IpfsNode, nodeId string) (*nodepb.StorageStat_Host, error)
- func GetNowStats(ctx context.Context, cfg *config.Config, node *core.IpfsNode, ...) (hs *nodepb.StorageStat_Host, err error)
- func SaveHostStatsIntoDatastore(ctx context.Context, node *core.IpfsNode, nodeId string, ...) error
- func SyncStats(ctx context.Context, cfg *config.Config, node *core.IpfsNode, ...) error
- type Stat_HostWithTimeStamp
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 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 GetNowStats ¶
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
Types ¶
type Stat_HostWithTimeStamp ¶
type Stat_HostWithTimeStamp struct { Stat nodepb.StorageStat_Host `json:"stat"` Timestamp int64 `json:"timestamp"` }
Click to show internal directories.
Click to hide internal directories.