utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: GPL-3.0, GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGptnNet added in v1.0.3

func CreateGptnNet(client *docker.Client)

func GetAllContainers added in v1.0.3

func GetAllContainers(client *docker.Client) ([]docker.APIContainers, error)

获取所有容器

func GetAllExitedContainer

func GetAllExitedContainer(cons []docker.APIContainers) ([]common.Address, error)

获取用户合约异常退出的监听函数

func GetAllResourceUsageByContainerName

func GetAllResourceUsageByContainerName(name string) (*docker.Stats, error)

func GetCPUUsageTotalUsage

func GetCPUUsageTotalUsage(stats *docker.Stats) (uint64, error)

func GetDiskForEachContainer

func GetDiskForEachContainer(client *docker.Client, disk int64)

获取所以用户合约使用的磁盘容量

func GetLogFromContainer

func GetLogFromContainer(name string) string

通过容器名称获取容器里面的错误信息,返回最后一条

func GetMemoryStatsLimit

func GetMemoryStatsLimit(stats *docker.Stats) (uint64, error)

func GetMemoryStatsUsage

func GetMemoryStatsUsage(stats *docker.Stats) (uint64, error)

func GetResourcesWhenInvokeContainer

func GetResourcesWhenInvokeContainer(cc *list.CCInfo)

func IsRunning added in v1.0.3

func IsRunning(name string) bool

判断容器是否正在运行

func RemoveConWhenOverDisk

func RemoveConWhenOverDisk(cc *list.CCInfo, dag dag.IDag) (sizeRW int64, disk int64, isOver bool)

调用的时候,若调用完发现磁盘使用超过系统上限,则kill掉并移除

func RemoveContainerWhenGoBuildTimeOut

func RemoveContainerWhenGoBuildTimeOut(id string)

编译超时,移除容器

func RetrieveExpiredContainers added in v1.0.3

func RetrieveExpiredContainers(idag dag.IDag, containers []docker.APIContainers, rmExpConFromSysParam bool) map[string]common.Address

获取所有过期的容器ID(通过交易上的)

func StopContainerWhenInvokeTimeOut

func StopContainerWhenInvokeTimeOut(name string)

当调用合约时,发生超时,即停止掉容器

Types

type UccInterface

type UccInterface interface {
	//  获取容器使用全部资源
	GetResourcesWhenInvokeContainer(cc *list.CCInfo)
	GetAllResourceUsageByContainerName(name string) (*docker.Stats, error)
	//  获取CPU使用
	GetCPUUsageTotalUsage(stats *docker.Stats) (uint64, error)
	//  获取内存使用上限
	GetMemoryStatsLimit(stats *docker.Stats) (uint64, error)
	//  获取当前内存使用
	GetMemoryStatsUsage(stats *docker.Stats) (uint64, error)
	//  通过容器名称获取容器里面的错误信息,返回最后一条
	GetLogFromContainer(name string) string
	//  获取所以用户合约使用的磁盘容量
	GetDiskForEachContainer(client *docker.Client, disk int64)
	//  获取用户合约异常退出的监听函数
	GetAllExitedContainer(client *docker.Client) ([]common.Address, error)
	//  当调用合约时,发生超时,即停止掉容器
	StopContainerWhenInvokeTimeOut(name string)
	//  编译超时,移除容器
	RemoveContainerWhenGoBuildTimeOut(client *docker.Client, id string)
}

Jump to

Keyboard shortcuts

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