protected void accept()

in usage-statistics-impl/src/jetbrains/buildServer/usageStatistics/impl/providers/UIFeaturesStatisticsProvider.java [41:63]


  protected void accept(@NotNull final UsageStatisticsPublisher publisher,
                        @NotNull final UsageStatisticsPresentationManager presentationManager,
                        @NotNull final String periodDescription,
                        final long startDate) {
    final Map<SimplePropertyKey, Integer> counters = new HashMap<>();
    PROPERTIES.keySet().forEach(key -> counters.put(new SimplePropertyKey(key), 0));
    final List<Long> userIds = CollectionsUtil.convertCollection(myWebUsersProvider.getWebUsers(startDate), Long::valueOf);

    final String valueTooltip = "User count (% of active web users)";
    final UsageStatisticsFormatter formatter = new PercentageFormatter(userIds.size());

    myUserModel.findUsersByIds(userIds).forEach(user ->
                                                  counters.forEach((key, value) -> {
                                                    if (user.getBooleanProperty(key)) {
                                                      counters.put(key, counters.get(key) + 1);
                                                    }
                                                  }));
    counters.forEach((simplePropertyKey, count) -> {
      final String id = makeId("feature", periodDescription, simplePropertyKey.getKey());
      presentationManager.applyPresentation(id, PROPERTIES.get(simplePropertyKey.getKey()), myGroupName, formatter, valueTooltip);
      publisher.publishStatistic(id, count);
    });
  }