model

package
v0.0.2-0...-b3cfdcc Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	// ipv4 or ipv6
	Type     string `json:"type"`
	WriteOut int64  `json:"write_out"`
	ReadIn   int64  `json:"read_in"`
}

type ConnectionMeta

type ConnectionMeta struct {
	SourceIP   string `json:"source_ip"`
	DestIP     string `json:"dest_ip"`
	SourcePort int    `json:"source_port"`
	DestPort   int    `json:"dest_port"`
}

type Container

type Container struct {
	ID   string `json:"id"`
	Name string `json:"name"`

	SystemCalls

	FileSystem

	Network
}

func NewContainer

func NewContainer(id, name string, layerData map[string]string) (*Container, error)

type Digest

type Digest string

type File

type File struct {
	Name     string     `json:"-"`
	WriteOut int64      `json:"write_out"`
	ReadIn   int64      `json:"read_in"`
	Layer    *LayerInfo `json:"-"`
}

type FileSystem

type FileSystem struct {
	// map file name to file
	AccessedFiles map[string]*File `json:"-"`
	// map layer path to layer info
	AccessedLayers map[string]*LayerInfo `json:"-"`
	// we have to record this to ensure the file search order
	LayersInOrder []string `json:"-"`
	// io calls whose latency is bigger than 1ms
	IOCalls1 []*IOCall `json:"io_calls_more_than_1ms"`
	// io calls whose latency is bigger than 10ms
	IOCalls10 []*IOCall `json:"io_calls_more_than_10ms"`
	// io calls whose latency is bigger than 100ms
	IOCalls100    []*IOCall `json:"io_calls_more_than_100ms"`
	TotalReadIn   int64     `json:"file_total_read_in"`
	TotalWriteOut int64     `json:"file_total_write_out"`
}

type IOCall

type IOCall struct {
	FileName string        `json:"file_name"`
	Latency  time.Duration `json:"latency"`
}

type LayerInfo

type LayerInfo struct {
	Dir           string           `json:"dir"`
	AccessedFiles map[string]*File `json:"accessed_files"`
	WriteOut      int64            `json:"layer_write_out"`
	ReadIn        int64            `json:"layer_read_in"`
}

func NewLayerInfo

func NewLayerInfo(dir string) *LayerInfo

type Network

type Network struct {
	ActiveConnections map[ConnectionMeta]*Connection `json:"-"`
	TotalReadIn       int64                          `json:"net_total_read_in"`
	TotalWriteOut     int64                          `json:"net_total_wirte_out"`
}

type SystemCall

type SystemCall struct {
	Name string `json:"-"`
	// total number of times it is invoked
	Calls     int64         `json:"calls"`
	TotalTime time.Duration `json:"total_time"`
}

type SystemCalls

type SystemCalls struct {
	// map system call name to SystemCall
	IndividualCalls map[string]*SystemCall `json:"individual_calls"`
	TotalCalls      int64                  `json:"total_calls"`
}

Jump to

Keyboard shortcuts

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