Skip to content

Commit

Permalink
Add a timer around DataApiRequestMappers. (#250)
Browse files Browse the repository at this point in the history
DataApiRequestMappers are allowed to perform arbitrary
transformations on the `DataApiRequest`. As a result, these mappers may
be very expensive. So, we should add a timer that allows customers to
easily see if they are spending all their time in their own mappers.
  • Loading branch information
archolewa authored and cdeszaq committed Apr 20, 2017
1 parent c3e2261 commit dfd252e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Current

- [Add Reciprocal `satisfies()` relationship complementing `satisfiedBy()` on Granularity](https://github.com/yahoo/fili/issues/222)

- [Add a timer around DataApiRequestMappers](https://github.com/yahoo/fili/pull/250)

- [MetricUnionAvailability and MetricUnionCompositeTable](https://github.com/yahoo/fili/pull/193)
* Added `MetricUnionAvailability` which puts metric columns of different availabilities together and
`MetricUnionCompositeTable` which puts metric columns of different tables together in a single table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ public void getData(
}

if (requestMapper != null) {
apiRequest = (DataApiRequest) requestMapper.apply(apiRequest, containerRequestContext);
try (TimedPhase timer = RequestLog.startTiming("DataApiRequestMappers")) {
apiRequest = (DataApiRequest) requestMapper.apply(apiRequest, containerRequestContext);
}
}

// Build the query template
Expand Down

0 comments on commit dfd252e

Please sign in to comment.