summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/wicket/pages
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-06-01 19:51:41 -0400
committerJames Moger <james.moger@gitblit.com>2011-06-01 19:51:41 -0400
commit424fe1b372d225d65eb42e6125b24cbb982c5969 (patch)
tree587c27859ec4289268ad3e65ad74acbe72f1686f /src/com/gitblit/wicket/pages
parentf1720ca884bc3fa9da1288ad955e46f165aa4168 (diff)
downloadgitblit-424fe1b372d225d65eb42e6125b24cbb982c5969.tar.gz
gitblit-424fe1b372d225d65eb42e6125b24cbb982c5969.zip
Stats -> Metrics. Docs in distribution zip. Created MetricUtils.
Diffstat (limited to 'src/com/gitblit/wicket/pages')
-rw-r--r--src/com/gitblit/wicket/pages/MetricsPage.html (renamed from src/com/gitblit/wicket/pages/StatsPage.html)0
-rw-r--r--src/com/gitblit/wicket/pages/MetricsPage.java (renamed from src/com/gitblit/wicket/pages/StatsPage.java)16
-rw-r--r--src/com/gitblit/wicket/pages/RepositoryPage.html2
-rw-r--r--src/com/gitblit/wicket/pages/RepositoryPage.java4
-rw-r--r--src/com/gitblit/wicket/pages/SummaryPage.html2
-rw-r--r--src/com/gitblit/wicket/pages/SummaryPage.java7
6 files changed, 16 insertions, 15 deletions
diff --git a/src/com/gitblit/wicket/pages/StatsPage.html b/src/com/gitblit/wicket/pages/MetricsPage.html
index d6f23e01..d6f23e01 100644
--- a/src/com/gitblit/wicket/pages/StatsPage.html
+++ b/src/com/gitblit/wicket/pages/MetricsPage.html
diff --git a/src/com/gitblit/wicket/pages/StatsPage.java b/src/com/gitblit/wicket/pages/MetricsPage.java
index 0b16211e..2186ae37 100644
--- a/src/com/gitblit/wicket/pages/StatsPage.java
+++ b/src/com/gitblit/wicket/pages/MetricsPage.java
@@ -39,15 +39,15 @@ import org.wicketstuff.googlecharts.MarkerType;
import org.wicketstuff.googlecharts.ShapeMarker;
import com.gitblit.models.Metric;
-import com.gitblit.utils.JGitUtils;
+import com.gitblit.utils.MetricUtils;
import com.gitblit.wicket.WicketUtils;
-public class StatsPage extends RepositoryPage {
+public class MetricsPage extends RepositoryPage {
- public StatsPage(PageParameters params) {
+ public MetricsPage(PageParameters params) {
super(params);
Repository r = getRepository();
- insertLinePlot("commitsChart", JGitUtils.getDateMetrics(r, false));
+ insertLinePlot("commitsChart", MetricUtils.getDateMetrics(r, false));
insertBarPlot("dayOfWeekChart", getDayOfWeekMetrics(r));
insertLinePlot("timeOfDayChart", getTimeOfDayMetrics(r));
insertPieChart("authorsChart", getAuthorMetrics(r));
@@ -119,7 +119,7 @@ public class StatsPage extends RepositoryPage {
}
private List<Metric> getDayOfWeekMetrics(Repository repository) {
- List<Metric> list = JGitUtils.getDateMetrics(repository, false, "E");
+ List<Metric> list = MetricUtils.getDateMetrics(repository, false, "E");
SimpleDateFormat sdf = new SimpleDateFormat("E");
Calendar cal = Calendar.getInstance();
@@ -146,7 +146,7 @@ public class StatsPage extends RepositoryPage {
private List<Metric> getTimeOfDayMetrics(Repository repository) {
SimpleDateFormat ndf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
- List<Metric> list = JGitUtils.getDateMetrics(repository, false, "yyyy-MM-dd HH:mm");
+ List<Metric> list = MetricUtils.getDateMetrics(repository, false, "yyyy-MM-dd HH:mm");
Calendar cal = Calendar.getInstance();
for (Metric metric : list) {
@@ -164,7 +164,7 @@ public class StatsPage extends RepositoryPage {
}
private List<Metric> getAuthorMetrics(Repository repository) {
- List<Metric> authors = JGitUtils.getAuthorMetrics(repository);
+ List<Metric> authors = MetricUtils.getAuthorMetrics(repository);
Collections.sort(authors, new Comparator<Metric>() {
@Override
public int compare(Metric o1, Metric o2) {
@@ -184,6 +184,6 @@ public class StatsPage extends RepositoryPage {
@Override
protected String getPageName() {
- return getString("gb.stats");
+ return getString("gb.metrics");
}
}
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.html b/src/com/gitblit/wicket/pages/RepositoryPage.html
index 0f245eff..ffb484f1 100644
--- a/src/com/gitblit/wicket/pages/RepositoryPage.html
+++ b/src/com/gitblit/wicket/pages/RepositoryPage.html
@@ -18,7 +18,7 @@
<!-- page nav links -->
<div class="page_nav">
- <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> | <a wicket:id="stats"><wicket:message key="gb.stats"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>
+ <a wicket:id="summary"><wicket:message key="gb.summary"></wicket:message></a> | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="branches"><wicket:message key="gb.branches"></wicket:message></a> | <a wicket:id="tags"><wicket:message key="gb.tags"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a> | <a wicket:id="metrics"><wicket:message key="gb.metrics"></wicket:message></a> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>
</div>
</div>
diff --git a/src/com/gitblit/wicket/pages/RepositoryPage.java b/src/com/gitblit/wicket/pages/RepositoryPage.java
index 2610c4c6..143d885a 100644
--- a/src/com/gitblit/wicket/pages/RepositoryPage.java
+++ b/src/com/gitblit/wicket/pages/RepositoryPage.java
@@ -75,7 +75,7 @@ public abstract class RepositoryPage extends BasePage {
put("branches", "gb.branches");
put("tags", "gb.tags");
put("tree", "gb.tree");
- put("stats", "gb.stats");
+ put("metrics", "gb.metrics");
put("tickets", "gb.tickets");
put("edit", "gb.edit");
}
@@ -104,7 +104,7 @@ public abstract class RepositoryPage extends BasePage {
WicketUtils.newRepositoryParameter(repositoryName)));
add(new BookmarkablePageLink<Void>("tree", TreePage.class,
WicketUtils.newRepositoryParameter(repositoryName)));
- add(new BookmarkablePageLink<Void>("stats", StatsPage.class,
+ add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class,
WicketUtils.newRepositoryParameter(repositoryName)));
// per-repository extra page links
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.html b/src/com/gitblit/wicket/pages/SummaryPage.html
index 1a90c998..ed94192a 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.html
+++ b/src/com/gitblit/wicket/pages/SummaryPage.html
@@ -19,7 +19,7 @@
<tr><th><wicket:message key="gb.description">[description]</wicket:message></th><td><span wicket:id="repositoryDescription">[repository description]</span></td></tr>
<tr><th><wicket:message key="gb.owner">[owner]</wicket:message></th><td><span wicket:id="repositoryOwner">[repository owner]</span></td></tr>
<tr><th><wicket:message key="gb.lastChange">[last change]</wicket:message></th><td><span wicket:id="repositoryLastChange">[repository last change]</span></td></tr>
- <tr><th><wicket:message key="gb.stats">[stats]</wicket:message></th><td><span wicket:id="repositoryStats">[repository stats]</span></td></tr>
+ <tr><th><wicket:message key="gb.metrics">[metrics]</wicket:message></th><td><span wicket:id="repositoryMetrics">[repository metrics]</span></td></tr>
<tr><th valign="top"><wicket:message key="gb.url">[URL]</wicket:message></th><td><img style="vertical-align: top; padding-right:5px;" wicket:id="accessRestrictionIcon" /><span wicket:id="repositoryCloneUrl">[repository clone url]</span></td></tr>
</table>
</div>
diff --git a/src/com/gitblit/wicket/pages/SummaryPage.java b/src/com/gitblit/wicket/pages/SummaryPage.java
index 1157d30c..f8206941 100644
--- a/src/com/gitblit/wicket/pages/SummaryPage.java
+++ b/src/com/gitblit/wicket/pages/SummaryPage.java
@@ -43,6 +43,7 @@ import com.gitblit.GitBlit;
import com.gitblit.Keys;
import com.gitblit.models.Metric;
import com.gitblit.utils.JGitUtils;
+import com.gitblit.utils.MetricUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.utils.TimeUtils;
import com.gitblit.wicket.WicketUtils;
@@ -72,7 +73,7 @@ public class SummaryPage extends RepositoryPage {
List<Metric> metrics = null;
Metric metricsTotal = null;
if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
- metrics = JGitUtils.getDateMetrics(r, true);
+ metrics = MetricUtils.getDateMetrics(r, true);
metricsTotal = metrics.remove(0);
}
@@ -83,9 +84,9 @@ public class SummaryPage extends RepositoryPage {
add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r),
getTimeZone()));
if (metricsTotal == null) {
- add(new Label("repositoryStats", ""));
+ add(new Label("repositoryMetrics", ""));
} else {
- add(new Label("repositoryStats", MessageFormat.format(
+ add(new Label("repositoryMetrics", MessageFormat.format(
"{0} commits and {1} tags in {2}", metricsTotal.count, metricsTotal.tag,
TimeUtils.duration(metricsTotal.duration))));
}