Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #869 from zalando/ARUHA-1640
Browse files Browse the repository at this point in the history
ARUHA-1640: improve light stats performance;
  • Loading branch information
v-stepanov authored May 15, 2018
2 parents be20aea + ee342bd commit 81bd9f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [2.6.7] - 2018-05-15

### Fixed
- Improved performance of listing subscriptions with their status

## [2.6.6] - 2018-05-08

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,14 @@ private SubscriptionEventTypeStats getEventTypeStats(final Optional<ZkSubscripti
private SubscriptionEventTypeStats getEventTypeLightStats(final Optional<ZkSubscriptionNode> subscriptionNode,
final EventType eventType) {
final List<SubscriptionEventTypeStats.Partition> resultPartitions = new ArrayList<>();
for (final String partition: getPartitionsList(eventType)) {

final List<String> partitionsList = subscriptionNode.map(
node -> node.getPartitions().stream()
.map(Partition::getPartition)
.collect(Collectors.toList()))
.orElseGet(() -> getPartitionsList(eventType));

for (final String partition : partitionsList) {
resultPartitions.add(getPartitionStats(subscriptionNode, eventType.getName(), partition, null));
}
resultPartitions.sort(Comparator.comparing(SubscriptionEventTypeStats.Partition::getPartition));
Expand Down

0 comments on commit 81bd9f9

Please sign in to comment.