hit_tracker

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CAS         CacheMode = iota // CAS cache
	ActionCache                  // Action cache

	Hit counterType = iota
	Miss
	Upload

	DownloadSizeBytes
	UploadSizeBytes

	DownloadUsec
	UploadUsec

	CachedActionExecUsec
)

Variables

This section is empty.

Functions

func CollectCacheStats

func CollectCacheStats(ctx context.Context, env environment.Env, iid string) *capb.CacheStats

Types

type CacheMode

type CacheMode int

type HitTracker

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

func NewHitTracker

func NewHitTracker(ctx context.Context, env environment.Env, actionCache bool) *HitTracker

func (*HitTracker) TrackDownload

func (h *HitTracker) TrackDownload(d *repb.Digest) *transferTimer

Example Usage:

ht := NewHitTracker(env, invocationID, false /*=actionCache*/) dlt := ht.TrackDownload(d) defer dlt.Close() ... body of download logic ...

func (*HitTracker) TrackEmptyHit

func (h *HitTracker) TrackEmptyHit() error

func (*HitTracker) TrackMiss

func (h *HitTracker) TrackMiss(d *repb.Digest) error

Example Usage:

ht := NewHitTracker(env, invocationID, false /*=actionCache*/)

if err := ht.TrackMiss(); err != nil {
  log.Printf("Error counting cache miss.")
}

func (*HitTracker) TrackUpload

func (h *HitTracker) TrackUpload(d *repb.Digest) *transferTimer

Example Usage:

ht := NewHitTracker(env, invocationID, false /*=actionCache*/) ult := ht.TrackUpload(d) defer ult.Close() ... body of download logic ...

Jump to

Keyboard shortcuts

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