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

Unified Diff: trace/service/impl.go

Issue 1413403002: Add a Ping() method to the trace service to make it easier to detect if the service is up and runni… (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: tests Created 5 years, 2 months 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 | trace/service/traceservice.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trace/service/impl.go
diff --git a/trace/service/impl.go b/trace/service/impl.go
index 43cba44585ef1d951198138f901851f0d6186790..1d735f1406dc7dc3c5d11fd9abba47c2eaf448c4 100644
--- a/trace/service/impl.go
+++ b/trace/service/impl.go
@@ -300,7 +300,7 @@ func (ts *TraceServiceImpl) MissingParams(ctx context.Context, in *MissingParams
return resp, nil
}
-func (ts *TraceServiceImpl) AddParams(ctx context.Context, in *AddParamsRequest) (*EmptyResponse, error) {
+func (ts *TraceServiceImpl) AddParams(ctx context.Context, in *AddParamsRequest) (*Empty, error) {
// Serialize the Params for each trace as a proto and collect the traceids.
// We do this outside the add func so there's less work taking place in the
// Update transaction.
@@ -329,10 +329,10 @@ func (ts *TraceServiceImpl) AddParams(ctx context.Context, in *AddParamsRequest)
if err := ts.db.Update(add); err != nil {
return nil, fmt.Errorf("Failed to add values to tracedb: %s", err)
}
- return &EmptyResponse{}, nil
+ return &Empty{}, nil
}
-func (ts *TraceServiceImpl) Add(ctx context.Context, in *AddRequest) (*EmptyResponse, error) {
+func (ts *TraceServiceImpl) Add(ctx context.Context, in *AddRequest) (*Empty, error) {
glog.Info("Add() begin.")
if in == nil {
return nil, fmt.Errorf("Received nil request.")
@@ -386,10 +386,10 @@ func (ts *TraceServiceImpl) Add(ctx context.Context, in *AddRequest) (*EmptyResp
if err := ts.db.Update(add); err != nil {
return nil, fmt.Errorf("Failed to add values to tracedb: %s", err)
}
- return &EmptyResponse{}, nil
+ return &Empty{}, nil
}
-func (ts *TraceServiceImpl) Remove(ctx context.Context, in *RemoveRequest) (*EmptyResponse, error) {
+func (ts *TraceServiceImpl) Remove(ctx context.Context, in *RemoveRequest) (*Empty, error) {
if in == nil {
return nil, fmt.Errorf("Received nil request.")
}
@@ -404,7 +404,7 @@ func (ts *TraceServiceImpl) Remove(ctx context.Context, in *RemoveRequest) (*Emp
if err := ts.db.Update(remove); err != nil {
return nil, fmt.Errorf("Failed to remove values from tracedb: %s", err)
}
- ret := &EmptyResponse{}
+ ret := &Empty{}
return ret, nil
}
@@ -517,6 +517,10 @@ func (ts *TraceServiceImpl) GetParams(ctx context.Context, getParamsRequest *Get
return ret, nil
}
+func (ts *TraceServiceImpl) Ping(ctx context.Context, empty *Empty) (*Empty, error) {
+ return &Empty{}, nil
+}
+
// Close closes the underlying datastore and it not part of the TraceServiceServer interface.
func (ts *TraceServiceImpl) Close() error {
return ts.db.Close()
« no previous file with comments | « no previous file | trace/service/traceservice.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698