gas

package
v0.0.0-...-a048d37 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CpuRate  = 1000
	MemRate  = 1000000
	DiskRate = 1
	FeeRate  = 1
)

Variables

View Source
var MaxLimits = Limits{
	Cpu:    maxResourceLimit,
	Memory: maxResourceLimit,
	Disk:   maxResourceLimit,
	Fee:    maxResourceLimit,
}

MaxLimits describes the maximum limit of resources

Functions

This section is empty.

Types

type Limits

type Limits struct {
	Cpu    int64
	Memory int64
	Disk   int64
	Fee    int64
}

Limits describes the usage or limit of resources

func (*Limits) Add

func (l *Limits) Add(l1 Limits) *Limits

Add accumulates resource limits, returns self.

func (Limits) Exceed

func (l Limits) Exceed(l1 Limits) bool

Exceed judge whether resource exceeds l1

func (*Limits) Sub

func (l *Limits) Sub(l1 Limits) *Limits

Sub sub limits from l

func (*Limits) TotalGas

func (l *Limits) TotalGas() int64

TotalGas converts resource to gas

Jump to

Keyboard shortcuts

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