You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/design/core/metrics/Design.md
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -193,10 +193,18 @@ MetricRegistry object so that upstream classes can use that information in thei
193
193
*`MetricsExecutionInterceptor` will always be the last configured ExecutionInterceptor in the interceptor chain
194
194
195
195
196
+
## Performance
197
+
One of the main tenet for metrics is “Enabling default metrics should have minimal impact on the application performance". The following design choices are made to ensure
198
+
enabling metrics does not effect performance significantly.
199
+
* When collecting metrics, a NoOpRegistry is used if metrics are disabled. All methods in this registry are no-op and return immediately.
200
+
This also has the additional benefit of avoid metricsEnabled check at each metric collection point.
201
+
* Metric publisher implementations can involve network calls and impact latency if done in blocking way. So all SDK publisher implementation
202
+
will process the metrics asynchronously and does not block the actual request.
203
+
204
+
196
205
## Testing
197
206
198
-
One of the main tenet for metrics is “Enabling default metrics should have minimal impact on the application performance.“
199
-
To ensure this, performance tests should be written and a baseline for overhead should be created.
207
+
To ensure performance is not impacted due to metrics, tests should be written with various scenarios and a baseline for overhead should be created.
200
208
These tests should be run regularly to catch regressions.
0 commit comments