本文整理汇总了Golang中go/skia/org/infra/golden/go/storage.Storage.GetTileStreamNow方法的典型用法代码示例。如果您正苦于以下问题:Golang Storage.GetTileStreamNow方法的具体用法?Golang Storage.GetTileStreamNow怎么用?Golang Storage.GetTileStreamNow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go/skia/org/infra/golden/go/storage.Storage
的用法示例。
在下文中一共展示了Storage.GetTileStreamNow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: Init
// Init starts a back ground process that feeds test and digest information
// to the diffstore to continously calculate diffs for new digests.
func Init(storages *storage.Storage) {
go func() {
// TODO(stephana): Once we have events that signal that a new tile
// is available, we want to process new tiles immediately instead
// of polling every so often.
tileStream := storages.GetTileStreamNow(2*time.Minute, true)
for {
tile := <-tileStream
tileLen := tile.LastCommitIndex() + 1
// digestSets is a map [testname] map [diget] bool.
digestSets := map[string]map[string]bool{}
for _, trace := range tile.Traces {
gTrace := trace.(*types.GoldenTrace)
testName := trace.Params()[types.PRIMARY_KEY_FIELD]
for _, digest := range gTrace.Values[:tileLen] {
if digest != types.MISSING_DIGEST {
if _, ok := digestSets[testName]; !ok {
digestSets[testName] = map[string]bool{}
}
digestSets[testName][digest] = true
}
}
}
storages.DiffStore.SetDigestSets(digestSets)
}
}()
}