James Moger
2012-04-11 a9eb6b1105cd47f00ae45dacda9af8e829ade191
src/com/gitblit/wicket/pages/MetricsPage.java
@@ -40,6 +40,7 @@
import com.gitblit.models.Metric;
import com.gitblit.utils.MetricUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.utils.TimeUtils;
import com.gitblit.wicket.WicketUtils;
@@ -48,15 +49,19 @@
   public MetricsPage(PageParameters params) {
      super(params);
      Repository r = getRepository();
      add(new Label("branchTitle", objectId));
      if (StringUtils.isEmpty(objectId)) {
         add(new Label("branchTitle", getRepositoryModel().HEAD));
      } else {
         add(new Label("branchTitle", objectId));
      }
      Metric metricsTotal = null;
      List<Metric> metrics = MetricUtils.getDateMetrics(r, objectId, true, null);
      List<Metric> metrics = MetricUtils.getDateMetrics(r, objectId, true, null, getTimeZone());
      metricsTotal = metrics.remove(0);
      if (metricsTotal == null) {
         add(new Label("branchStats", ""));
      } else {
         add(new Label("branchStats",
               MessageFormat.format("{0} commits and {1} tags in {2}", metricsTotal.count,
               MessageFormat.format(getString("gb.branchStats"), metricsTotal.count,
                     metricsTotal.tag, TimeUtils.duration(metricsTotal.duration))));
      }
      insertLinePlot("commitsChart", metrics);
@@ -130,7 +135,7 @@
   }
   private List<Metric> getDayOfWeekMetrics(Repository repository, String objectId) {
      List<Metric> list = MetricUtils.getDateMetrics(repository, objectId, false, "E");
      List<Metric> list = MetricUtils.getDateMetrics(repository, objectId, false, "E", getTimeZone());
      SimpleDateFormat sdf = new SimpleDateFormat("E");
      Calendar cal = Calendar.getInstance();