resources

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDockerContainer

func CreateDockerContainer(ctx context.Context, cli *client.Client, codePath string) (string, error)

func DownloadIPFSFile

func DownloadIPFSFile(ipfsURL string) (string, error)

Types

type ResourceStats

type ResourceStats struct {
	MemoryUsage   uint64  `json:"memory_usage"`
	CPUPercentage float64 `json:"cpu_percentage"`
	NetworkRx     uint64  `json:"network_rx"`
	NetworkTx     uint64  `json:"network_tx"`
	BlockRead     uint64  `json:"block_read"`
	BlockWrite    uint64  `json:"block_write"`
	// New bandwidth metrics
	RxBytes       uint64  `json:"rx_bytes"`
	RxPackets     uint64  `json:"rx_packets"`
	RxErrors      uint64  `json:"rx_errors"`
	RxDropped     uint64  `json:"rx_dropped"`
	TxBytes       uint64  `json:"tx_bytes"`
	TxPackets     uint64  `json:"tx_packets"`
	TxErrors      uint64  `json:"tx_errors"`
	TxDropped     uint64  `json:"tx_dropped"`
	BandwidthRate float64 `json:"bandwidth_rate"` // bytes per second
	// Fee calculation fields
	TotalFee          float64 `json:"total_fee"`
	StaticComplexity  float64 `json:"static_complexity"`
	DynamicComplexity float64 `json:"dynamic_complexity"`
	ComplexityIndex   float64 `json:"complexity_index"`
	GasFees           float64 `json:"gas_fees"`
}

func MonitorResources

func MonitorResources(ctx context.Context, cli *client.Client, containerID string) (*ResourceStats, error)

Jump to

Keyboard shortcuts

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