-
Notifications
You must be signed in to change notification settings - Fork 4
Changes for duration from milli to micro #32
base: rzp_main
Are you sure you want to change the base?
Conversation
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.
Please add the appropriate test cases.
@@ -18,7 +18,7 @@ pinot.controllerPort = 9000 | |||
pinot.timeColumn = start_time_millis | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sunn-y-Arora I think it's better to have this consistently across all views.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -24,6 +24,9 @@ protocol BackendEntityViewProtocol { | |||
|
|||
long duration_millis = 0; | |||
|
|||
// duration micro | |||
double duration_micros = 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.
This can be long?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are talking about significant digits, not the range
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per discussion with team and tech specs I have added datatype as DOUBLE
@@ -18,6 +18,9 @@ protocol RawServiceViewProtocol { | |||
|
|||
long duration_millis; | |||
|
|||
// duration micro | |||
double duration_micros = 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.
Same
@@ -88,6 +88,7 @@ private BackendEntityView.Builder generateViewBuilder( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this to constants, or reuse if this is already defined.
@@ -50,6 +50,7 @@ List<RawServiceView> generateView( | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
@@ -367,7 +367,9 @@ private Event buildEvent( | |||
Map<String, MetricValue> metricMap = new HashMap<>(); | |||
MetricValue durationMetric = | |||
fastNewBuilder(MetricValue.Builder.class) | |||
.setValue((double) (endTimeMillis - startTimeMillis)) | |||
.setValue( |
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.
Also a test case for this?
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.
added
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.
LGTM, requesting minor changes.
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.