Skip to content

Commit

Permalink
Add TODO for a potential performance improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
riemanli committed May 1, 2023
1 parent fa8f2ce commit dd44a90
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,10 @@ class MetricsService(

return batchGetMetricsResponse {
metrics +=
/**
* TODO(@riemanli): a potential improvement can be done by only getting the metrics whose
* measurements are updated. Re-evaluate when a load-test is ready after deployment.
*/
if (anyMeasurementUpdated) {
batchGetInternalMetrics(principal.resourceKey.measurementConsumerId, externalMetricIds)
.map { it.toMetric() }
Expand Down Expand Up @@ -1084,8 +1088,13 @@ class MetricsService(
principal,
)

// If any measurement got updated, pull the list of the up-to-date internal metrics. Otherwise,
// use the original list.
/**
* If any measurement got updated, pull the list of the up-to-date internal metrics. Otherwise,
* use the original list.
*
* TODO(@riemanli): a potential improvement can be done by only getting the metrics whose
* measurements are updated. Re-evaluate when a load-test is ready after deployment.
*/
val internalMetrics: List<InternalMetric> =
if (anyMeasurementUpdated) {
batchGetInternalMetrics(
Expand Down

0 comments on commit dd44a90

Please sign in to comment.