Skip to content

Commit

Permalink
Fix latency numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
mangalaman93 committed Nov 7, 2019
1 parent 9bd503e commit fd37c03
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions edgraph/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,9 @@ func (s *Server) doQuery(ctx context.Context, req *api.Request, authorize int) (
}
}

// TODO(martinmr): Include Transport as part of the latency. Need to do this separately
// since it involves modifying the API protos.
// TODO (Aman): may need to calculate processing time here!!!
// TODO(martinmr): Include Transport as part of the latency. Need to do
// this separately since it involves modifying the API protos.
l.Processing = time.Since(l.Start) - l.Parsing - l.AssignTimestamp - l.Json
resp.Latency = &api.Latency{
AssignTimestampNs: uint64(l.AssignTimestamp.Nanoseconds()),
ParsingNs: uint64(l.Parsing.Nanoseconds()),
Expand Down
4 changes: 0 additions & 4 deletions query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2579,7 +2579,6 @@ func (req *Request) ProcessQuery(ctx context.Context) (err error) {
}
req.Latency.Parsing += time.Since(loopStart)

execStart := time.Now()
hasExecuted := make([]bool, len(req.Subgraphs))
numQueriesDone := 0

Expand Down Expand Up @@ -2685,7 +2684,6 @@ func (req *Request) ProcessQuery(ctx context.Context) (err error) {
return errors.Errorf("Query couldn't be executed")
}
}
req.Latency.Processing += time.Since(execStart)

// If we had a shortestPath SG, append it to the result.
if len(shortestSg) != 0 {
Expand All @@ -2709,7 +2707,6 @@ func (req *Request) Process(ctx context.Context) (er ExecutionResult, err error)
}
er.Subgraphs = req.Subgraphs

schemaProcessingStart := time.Now()
if req.GqlQuery.Schema != nil {
if er.SchemaNode, err = worker.GetSchemaOverNetwork(ctx, req.GqlQuery.Schema); err != nil {
return er, errors.Wrapf(err, "while fetching schema")
Expand All @@ -2718,7 +2715,6 @@ func (req *Request) Process(ctx context.Context) (er ExecutionResult, err error)
return er, errors.Wrapf(err, "while fetching types")
}
}
req.Latency.Processing += time.Since(schemaProcessingStart)

return er, nil
}
Expand Down

0 comments on commit fd37c03

Please sign in to comment.