Changes for duration from milli to micro#32
Changes for duration from milli to micro#32TriptiTripathi1234 wants to merge 14 commits intorzp_mainfrom
Conversation
suddendust
left a comment
There was a problem hiding this comment.
Please add the appropriate test cases.
| pinot.timeUnit = MILLISECONDS | ||
| # todo: Add Attributes and Metrics after adding map type value | ||
| pinot.dimensionColumns = [tenant_id, span_kind, error_count, exception_count, duration_millis, end_time_millis, api_name, service_name, span_id, trace_id, protocol_name, status_code, service_id, api_id, num_calls, api_discovery_state, space_ids] | ||
| pinot.dimensionColumns = [tenant_id, span_kind, error_count, exception_count, duration_millis, duration_micros, end_time_millis, api_name, service_name, span_id, trace_id, protocol_name, status_code, service_id, api_id, num_calls, api_discovery_state, space_ids] |
There was a problem hiding this comment.
why do we need this duration in micro across views, I think as per my understanding, only the span event view needed that (and the backend entity view).
There was a problem hiding this comment.
@Sunn-y-Arora I think it's better to have this consistently across all views.
There was a problem hiding this comment.
not required right? raw-service (for eg) view gives service ka overall rsp time, it will never be in micro, so unnecessary change
There was a problem hiding this comment.
True but why have two different units in two different views? We'll anyway get rid of duration_millis across all tables, if extra storage and indexing cost is a concern. This also makes code the query side simpler, as it doesn't have to differentiate b/w the two columns IMO.
There was a problem hiding this comment.
As pointed out by Prashant, added it in micro across views so that all the views have consistency.
Codecov Report
@@ Coverage Diff @@
## rzp_main #32 +/- ##
===========================================
Coverage ? 79.45%
Complexity ? 1311
===========================================
Files ? 118
Lines ? 5271
Branches ? 481
===========================================
Hits ? 4188
Misses ? 865
Partials ? 218
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e325c64 to
a2e6974
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
added @suddendust |
| long duration_millis = 0; | ||
|
|
||
| // duration micro | ||
| double duration_micros = 0; |
There was a problem hiding this comment.
As per our discussion, we went with double to store all the significant digits(might need in future). Making it LONG will defeat this purpose.
There was a problem hiding this comment.
Long's upper limit is 9223372036854775807, which is equal to 292471.20867753599305 years. Do you think a span's duration will exceed this value?
There was a problem hiding this comment.
we are talking about significant digits, not the range
There was a problem hiding this comment.
let's say we have .123 ms that would be 0ms(in LONG), 123 micro seconds(LONG).
Now if we have .1234ms that would be 123 micro seconds(if LONG), 123.4 micro seconds(if DOUBLE). Isnt it?
There was a problem hiding this comment.
Aren't we solving for microsecond granularity? It means the smallest duration we can report is 1µ. So 123.4 µs should be rounded off to 123 µs. This will keep things on the query layer simples as you wouldn't have to deal with converting data types.
There was a problem hiding this comment.
As per discussion with team and tech specs I have added datatype as DOUBLE
| long duration_millis; | ||
|
|
||
| // duration micro | ||
| double duration_micros = 0; |
| builder.setStartTimeMillis(event.getStartTimeMillis()); | ||
| builder.setEndTimeMillis(event.getEndTimeMillis()); | ||
| builder.setDurationMillis(event.getEndTimeMillis() - event.getStartTimeMillis()); | ||
| builder.setDurationMicros(event.getMetrics().getMetricMap().get("Duration").getValue()); |
There was a problem hiding this comment.
Move this to constants, or reuse if this is already defined.
| builder.setStartTimeMillis(event.getStartTimeMillis()); | ||
| builder.setEndTimeMillis(event.getEndTimeMillis()); | ||
| builder.setDurationMillis(event.getEndTimeMillis() - event.getStartTimeMillis()); | ||
| builder.setDurationMicros(event.getMetrics().getMetricMap().get("Duration").getValue()); |
| MetricValue durationMetric = | ||
| fastNewBuilder(MetricValue.Builder.class) | ||
| .setValue((double) (endTimeMillis - startTimeMillis)) | ||
| .setValue( |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1f91e69 to
e249e33
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
35c64eb to
272e8a3
Compare
Duration is in milli second currently. Changes are done to change in to micro seconds.