scheduler

package
v0.0.0-...-03b21cd Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package scheduler provides the scheduler, which takes requests of particular types (e.g. read, write, open) and returns how long they should wait before completing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Request

type Request struct {
	Type      RequestType
	Timestamp time.Time
	Path      string
	Start     units.NumBytes
	Size      units.NumBytes
}

Request contains information for all types of requests.

type RequestType

type RequestType int64

RequestType denotes what type a request is.

const (
	ReadRequest RequestType = iota
	WriteRequest
	OpenRequest
	CloseRequest
	FsyncRequest
	AllocateRequest
	MetadataRequest
)

Enumeration of different types of requests.

type Scheduler

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

Scheduler determines how long operations should take given a description of a physical medium.

func New

func New(config *slowfs.DeviceConfig) *Scheduler

New creates a new Scheduler using the given DeviceConfig to help compute how long requests should take.

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(req *Request) time.Duration

Schedule schedules a new request and returns how long the request should take. N.B. this can block.

Jump to

Keyboard shortcuts

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