| | |
| | | }
|
| | | }
|
| | |
|
| | | GoogleCharts charts = createCharts(pushes, authorExclusions);
|
| | | add(new HeaderContributor(charts));
|
| | | addCharts(pushes, authorExclusions, daysBack);
|
| | | } else {
|
| | | add(new Label("feedheader").setVisible(false));
|
| | | }
|
| | |
|
| | | // active repository list
|
| | |
| | | * and the active authors pie chart
|
| | | *
|
| | | * @param recentPushes
|
| | | * @return
|
| | | * @param authorExclusions
|
| | | * @param daysBack
|
| | | */
|
| | | private GoogleCharts createCharts(List<PushLogEntry> recentPushes, Set<String> authorExclusions) {
|
| | | private void addCharts(List<PushLogEntry> recentPushes, Set<String> authorExclusions, int daysBack) {
|
| | | // activity metrics
|
| | | Map<String, Metric> repositoryMetrics = new HashMap<String, Metric>();
|
| | | Map<String, Metric> authorMetrics = new HashMap<String, Metric>();
|
| | |
|
| | | // aggregate repository and author metrics
|
| | | int totalCommits = 0;
|
| | | for (PushLogEntry push : recentPushes) {
|
| | |
|
| | | // aggregate repository metrics
|
| | |
| | | repositoryMetrics.get(repository).count += 1;
|
| | |
|
| | | for (RepositoryCommit commit : push.getCommits()) {
|
| | | totalCommits++;
|
| | | String author = StringUtils.removeNewlines(commit.getAuthorIdent().getName());
|
| | | String authorName = author.toLowerCase();
|
| | | String authorEmail = StringUtils.removeNewlines(commit.getAuthorIdent().getEmailAddress()).toLowerCase();
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | add(new Label("feedheader", MessageFormat.format(getString("gb.recentActivityStats"),
|
| | | daysBack, totalCommits, authorMetrics.size())));
|
| | |
|
| | | // build google charts
|
| | | GoogleCharts charts = new GoogleCharts();
|
| | |
| | | chart.setShowLegend(false);
|
| | | charts.addChart(chart);
|
| | |
|
| | | return charts;
|
| | | add(new HeaderContributor(charts));
|
| | | }
|
| | |
|
| | | class RepoListItem implements Serializable {
|