Documentation
¶
Index ¶
Constants ¶
View Source
const ( CAS CacheMode = iota // CAS cache ActionCache // Action cache Hit counterType = iota Miss Upload DownloadSizeBytes UploadSizeBytes DownloadUsec UploadUsec )
Variables ¶
This section is empty.
Functions ¶
func CollectCacheStats ¶
func CollectCacheStats(ctx context.Context, env environment.Env, iid string) *capb.CacheStats
Types ¶
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 ...
Click to show internal directories.
Click to hide internal directories.