Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix how enconding_ns is calculated. #3692

Merged
merged 1 commit into from
Jul 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions edgraph/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,8 @@ func (s *Server) doQuery(ctx context.Context, req *api.Request) (resp *api.Respo
if er, err = queryRequest.Process(ctx); err != nil {
return resp, errors.Wrap(err, "")
}
l.Transport = time.Since(l.Start) - l.Parsing - l.Processing

var js []byte
if len(er.SchemaNode) > 0 || len(er.Types) > 0 {
sort.Slice(er.SchemaNode, func(i, j int) bool {
Expand All @@ -813,6 +815,8 @@ func (s *Server) doQuery(ctx context.Context, req *api.Request) (resp *api.Respo
resp.Json = js
span.Annotatef(nil, "Response = %s", js)

// TODO(martinmr): Include Transport as part of the latency. Need to do this separately
// since it involves modifying the API protos.
gl := &api.Latency{
ParsingNs: uint64(l.Parsing.Nanoseconds()),
ProcessingNs: uint64(l.Processing.Nanoseconds()),
Expand Down
2 changes: 1 addition & 1 deletion query/outputnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ type Extensions struct {

func (sg *SubGraph) toFastJSON(l *Latency) ([]byte, error) {
defer func() {
l.Json = time.Since(l.Start) - l.Parsing - l.Processing
l.Json = time.Since(l.Start) - l.Parsing - l.Processing - l.Transport
}()

var seedNode *fastJsonNode
Expand Down
1 change: 1 addition & 0 deletions query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ type Latency struct {
Start time.Time `json:"-"`
Parsing time.Duration `json:"query_parsing"`
Processing time.Duration `json:"processing"`
Transport time.Duration `json:"transport"`
Json time.Duration `json:"json_conversion"`
}

Expand Down