Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Unified Diff: go/trace/db/db.go

Issue 1411633008: perf: moving to tracebd (Closed) Base URL: https://skia.googlesource.com/buildbot@ts
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | perf/go/alerting/alerting.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/trace/db/db.go
diff --git a/go/trace/db/db.go b/go/trace/db/db.go
index 1d528e5bcd6ff71ccca36f2795115f77dd598ace..c6ecbd989282222458f949577744d3371a61a1a0 100644
--- a/go/trace/db/db.go
+++ b/go/trace/db/db.go
@@ -128,6 +128,9 @@ func (ts *TsDB) ping() error {
// addChunk adds a set of entries to the datastore at the given CommitID.
func (ts *TsDB) addChunk(ctx context.Context, cid *traceservice.CommitID, chunk map[string]*Entry) error {
+ if len(chunk) == 0 {
+ return nil
+ }
addReq := &traceservice.AddRequest{
Commitid: cid,
Values: []*traceservice.ValuePair{},
@@ -150,8 +153,7 @@ func (ts *TsDB) addChunk(ctx context.Context, cid *traceservice.CommitID, chunk
})
}
if len(addParamsRequest.Params) > 0 {
- _, err := ts.traceService.AddParams(ctx, addParamsRequest)
- if err != nil {
+ if _, err := ts.traceService.AddParams(ctx, addParamsRequest); err != nil {
return fmt.Errorf("Failed to add params: %s", err)
}
}
@@ -275,6 +277,10 @@ func (ts *TsDB) TileFromCommits(commitIDs []*CommitID) (*tiling.Tile, error) {
return
}
for _, pair := range getValuesResponse.Values {
+ if pair == nil {
+ glog.Errorf("Got a nil ValuePair in response: %s", err)
+ continue
+ }
tr, ok := tile.Traces[pair.Key]
if !ok {
tileMutex.Lock()
« no previous file with comments | « no previous file | perf/go/alerting/alerting.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698