-
Notifications
You must be signed in to change notification settings - Fork 109
Save performance metrics #137
Comments
I like the idea and it fits on the gitbase backlog. Just a couple of changes:
|
Instead of jaeger, we could use opencensus (https://github.com/census-instrumentation/opencensus-go), which has exporters for jaeger and many more, if we want to avoid vendor lock-in. OpenCensus already provides most of the functionality that's described in that interface, so we would not need to reinvent the wheel. |
@smola , what do you think about use opencensus instead of jaeger? for me is ok. |
Note that jaeger provides OpenTracing API, and if you limit yourself to that, it's not vendor-locking. On the other hand, OpenCensus has its own standard and implementations only for Golang and Java (so far). Which might be good for us. It also provides wider APIs (e.g. metrics). Whether we go with OpenTracing or OpenCensus, we can choose Jaeger/Zipkin/Other as server. |
Which one did we ended up choosing? |
Jaeger because is compatible with OpenTracin API |
Fixes src-d#137 This commit adds tracing of spans of execution in all nodes and expressions. Since expressions and functions evaluation is immediate, spans are finished inside the `Eval` function with a defer. In the case of plan nodes it's a bit more complex, as they just return an iterator that will be lazily evaluated. Measuring the span as just the time it takes to return the iterator would be wrong, so what it does is wrap all iterators with a `spanIter`, which iterates over an internal iterator and finishes the span when it's needed (there is an error, io.EOF is returned or `Close` is called) pushing some metrics like the number of processed rows or the error without needing the user to provide them. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Fixes src-d#137 This commit adds tracing of spans of execution in all nodes and expressions. Since expressions and functions evaluation is immediate, spans are finished inside the `Eval` function with a defer. In the case of plan nodes it's a bit more complex, as they just return an iterator that will be lazily evaluated. Measuring the span as just the time it takes to return the iterator would be wrong, so what it does is wrap all iterators with a `spanIter`, which iterates over an internal iterator and finishes the span when it's needed (there is an error, io.EOF is returned or `Close` is called) pushing some metrics like the number of processed rows or the error without needing the user to provide them. Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
It would be good to have saved performance metrics that we can use to understand the changes. As mentioned in #36 these metrics can be saved in
Session
or inContext
.Some of the data we can save is:
The proposal is adding a
Performance
interface to base session or context that can be used to save this data. It's done as an interface so we can have several implementations, some can get more info than others or disable collecting data in case it's too expensive.Then all the nodes have to be instrumented to save this data:
Extra tooling should be created to read and analyze this data. It would also be interesting to automate running tests with old and new code (for example
master
and PR) and comparing the data to find regressions.Thoughts? @ajnavarro, @erizocosmico, @mcarmonaa
The text was updated successfully, but these errors were encountered: