host

package
v0.0.0-...-a2102f8 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	E2BRunDir = "/run/e2b" // store sandbox metadata files here

)

Variables

This section is empty.

Functions

func PollForMMDSOpts

func PollForMMDSOpts(ctx context.Context, mmdsChan chan<- *MMDSOpts, envVars *utils.Map[string, string])

Types

type MMDSOpts

type MMDSOpts struct {
	TraceID    string `json:"traceID"`
	InstanceID string `json:"instanceID"`
	EnvID      string `json:"envID"`
	Address    string `json:"address"`
	TeamID     string `json:"teamID"`
}

func (*MMDSOpts) AddOptsToJSON

func (opts *MMDSOpts) AddOptsToJSON(jsonLogs []byte) ([]byte, error)

func (*MMDSOpts) Update

func (opts *MMDSOpts) Update(traceID, instanceID, envID, address, teamID string)

type Metrics

type Metrics struct {
	Timestamp int64 `json:"ts"` // Unix Timestamp in UTC

	CPUCount       uint32  `json:"cpu_count"`    // Total CPU cores
	CPUUsedPercent float32 `json:"cpu_used_pct"` // Percent rounded to 2 decimal places

	// Deprecated
	MemTotalMiB uint64 `json:"mem_total_mib"` // Total virtual memory in MiB
	// Deprecated
	MemUsedMiB uint64 `json:"mem_used_mib"` // Used virtual memory in MiB
	MemTotal   uint64 `json:"mem_total"`    // Total virtual memory in bytes
	MemUsed    uint64 `json:"mem_used"`     // Used virtual memory in bytes

	DiskUsed  uint64 `json:"disk_used"`  // Used disk space in bytes
	DiskTotal uint64 `json:"disk_total"` // Total disk space in bytes
}

func GetMetrics

func GetMetrics() (*Metrics, error)

Jump to

Keyboard shortcuts

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