fs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugTrace = false
)
View Source
const (
	UnmountFlag = syscall.MNT_FORCE | syscall.MNT_DETACH
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ByAccessTime

type ByAccessTime []*TraceItem

func (ByAccessTime) Len

func (b ByAccessTime) Len() int

func (ByAccessTime) Less

func (b ByAccessTime) Less(i, j int) bool

func (ByAccessTime) Swap

func (b ByAccessTime) Swap(i, j int)

type ByAccessTimeOptimized

type ByAccessTimeOptimized []*OptimizedTraceItem

func (ByAccessTimeOptimized) Len

func (bo ByAccessTimeOptimized) Len() int

func (ByAccessTimeOptimized) Less

func (bo ByAccessTimeOptimized) Less(i, j int) bool

func (ByAccessTimeOptimized) Swap

func (bo ByAccessTimeOptimized) Swap(i, j int)

type ImageManager

type ImageManager interface {
	GetPathByLayer(stack int64) string
	LookUpFile(stack int64, filename string) ReceivedFile
	LogTrace(stack int64, filename string, access, complete time.Time)
}

type Instance

type Instance struct {
	Root ReceivedFile
	// contains filtered or unexported fields
}

Instance should be created using

func NewInstance

func NewInstance(m ImageManager, root ReceivedFile, stack int64, dir string, options *fs.Options, debug bool) (fi *Instance, err error)

func (*Instance) GetMountPoint

func (fi *Instance) GetMountPoint() string

func (*Instance) GetServer

func (fi *Instance) GetServer() *fuse.Server

func (*Instance) Serve

func (fi *Instance) Serve()

func (*Instance) Teardown

func (fi *Instance) Teardown() error

Teardown unmounts the file system and close the logging file if there is one writing

type OptimizedGroup

type OptimizedGroup struct {
	History []*OptimizedTraceItem `json:"h"`
	Images  []string              `json:"i"`
}

type OptimizedTraceItem

type OptimizedTraceItem struct {
	TraceItem
	Rank        int `json:"r"`
	SourceImage int `json:"s"`
}

OptimizedTraceItem with ranking

func (OptimizedTraceItem) Key

func (oti OptimizedTraceItem) Key() string

type ReceivedFile

type ReceivedFile interface {
	GetChildren() []ReceivedFile
	AppendChild(children ReceivedFile)
	IsReady() bool
	GetAttr(out *fuse.Attr) syscall.Errno
	GetXAttrs() map[string][]byte
	GetName() string
	GetStableAttr() *fs.StableAttr
	GetLinkName() string
	GetRealPath() string
	WaitForReady()
}

type StarlightFsNode

type StarlightFsNode struct {
	fs.Inode
	ReceivedFile
	// contains filtered or unexported fields
}

func (*StarlightFsNode) Fsync

func (n *StarlightFsNode) Fsync(ctx context.Context, f fs.FileHandle, flags uint32) syscall.Errno

func (*StarlightFsNode) Getattr

func (n *StarlightFsNode) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*StarlightFsNode) Getxattr

func (n *StarlightFsNode) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno)

func (*StarlightFsNode) Listxattr

func (n *StarlightFsNode) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno)

func (*StarlightFsNode) Lookup

func (n *StarlightFsNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*StarlightFsNode) Open

func (*StarlightFsNode) Readdir

func (n *StarlightFsNode) Readlink(ctx context.Context) ([]byte, syscall.Errno)

type TraceCollection

type TraceCollection struct {
	Groups []*OptimizedGroup
	// contains filtered or unexported fields
}

func NewTraceCollection

func NewTraceCollection(ctx context.Context, p string) (*TraceCollection, error)

func NewTraceCollectionFromBuffer

func NewTraceCollectionFromBuffer(buf io.ReadCloser) (*TraceCollection, error)

func (TraceCollection) ToJSONBuffer

func (tc TraceCollection) ToJSONBuffer() []byte

type TraceItem

type TraceItem struct {
	FileName string        `json:"f"`
	Stack    int64         `json:"s"`
	Access   time.Duration `json:"a"`
	Wait     time.Duration `json:"w"`
}

type Tracer

type Tracer struct {
	// label could be the name of the application or the workload.
	// Different workload might have
	OptimizeGroup string    `json:"group"`
	Image         string    `json:"image"`
	StartTime     time.Time `json:"start"`

	Seq []*TraceItem `json:"seq"`
	// contains filtered or unexported fields
}

func NewTracer

func NewTracer(optimizeGroup, digest, outputDir string) (*Tracer, error)

func (*Tracer) Close

func (t *Tracer) Close() error

func (*Tracer) Log

func (t *Tracer) Log(fileName string, stack int64, accessTime, completeTime time.Time)

Jump to

Keyboard shortcuts

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