-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: extend call stats with error #36
Conversation
@@ -3,7 +3,7 @@ module github.com/foomo/gotsrpc/v2/example/basic | |||
go 1.16 | |||
|
|||
require ( | |||
github.com/foomo/gotsrpc/v2 v2.0.10 | |||
github.com/foomo/gotsrpc/v2 v2.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downgrade of gotsrpc?
@@ -108,6 +109,21 @@ func Reply(response []interface{}, stats *CallStats, r *http.Request, w http.Res | |||
if stats != nil { | |||
stats.ResponseSize = writer.length | |||
stats.Marshalling = time.Since(serializationStart) | |||
if len(response) > 0 { | |||
errResp := response[len(response)-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe to assume the last element is always the error?
@@ -11,6 +11,7 @@ import ( | |||
"os" | |||
"path" | |||
"path/filepath" | |||
"reflect" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reflection sucks a bit, we should try to get rid of that feature soonish
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any idea if there is a performance impact?
No description provided.