metering

package
v0.0.0-...-c56b1ab Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultInfraMeteringHeartbeatInterval = time.Duration(30) * time.Second
View Source
const EnvNspectId = "NVCF_NSPECT_ID"

Variables

This section is empty.

Functions

func NspectIdFromEnv

func NspectIdFromEnv() string

Types

type Config

type Config struct {
	Backend                string
	NcaId                  string
	BillingNcaId           string
	InstanceId             string
	InstanceType           string
	ICMSEnvironment        string
	ZoneName               string
	NspectId               string
	StartupTime            time.Time
	InfraHeartbeatInterval time.Duration
	GpuCount               int
	GpuType                string
	FunctionId             string
	FunctionVersionId      string
	FunctionTags           []string
	TaskId                 string
	TaskTags               []string
}

type EventDetails

type EventDetails struct {
	RequestId                string
	Subject                  string
	NcaId                    string
	InferenceDurationSeconds int
	InferenceSize            int64
	ResponseType             string
	BillingHeaders           map[string]string
	// contains filtered or unexported fields
}

func New

func New(config *Config, requestId string, subject string, ncaId string, headers []*pb.StringKV) *EventDetails

func (*EventDetails) Log

func (e *EventDetails) Log() error

type InfraMetering

type InfraMetering struct {
	// contains filtered or unexported fields
}

func NewInfraMetering

func NewInfraMetering(ctx context.Context, workload Workload, config *Config, status InfraStatus) *InfraMetering

func (*InfraMetering) Close

func (im *InfraMetering) Close() error

func (*InfraMetering) SetStatus

func (im *InfraMetering) SetStatus(status InfraStatus)

type InfraStatus

type InfraStatus string
const (
	InfraInitializing InfraStatus = "initializing"
	InfraReady        InfraStatus = "ready"
)

type Workload

type Workload string
const (
	Function Workload = "function"
	Task     Workload = "task"
)

Jump to

Keyboard shortcuts

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