Improved metrics page and added metrics links to branches panel.
| | |
| | | ### Todo List
|
| | | - Code documentation
|
| | | - Unit testing
|
| | | - Branch selector on Metrics
|
| | | - Blame
|
| | | - Clone remote repository
|
| | |
|
| | |
| | | public int compareTo(RefModel o) {
|
| | | return getDate().compareTo(o.getDate());
|
| | | }
|
| | | |
| | | @Override
|
| | | public String toString() {
|
| | | return displayName;
|
| | | }
|
| | | } |
| | |
| | |
|
| | | private static final Logger LOGGER = LoggerFactory.getLogger(MetricUtils.class);
|
| | |
|
| | | public static List<Metric> getDateMetrics(Repository r, boolean includeTotal, String format) {
|
| | | public static List<Metric> getDateMetrics(Repository r, String objectId, boolean includeTotal, String format) {
|
| | | Metric total = new Metric("TOTAL");
|
| | | final Map<String, Metric> metricMap = new HashMap<String, Metric>();
|
| | |
|
| | | if (StringUtils.isEmpty(objectId)) {
|
| | | objectId = Constants.HEAD;
|
| | | }
|
| | | if (JGitUtils.hasCommits(r)) {
|
| | | final List<RefModel> tags = JGitUtils.getTags(r, true, -1);
|
| | | final Map<ObjectId, RefModel> tagMap = new HashMap<ObjectId, RefModel>();
|
| | |
| | | }
|
| | | try {
|
| | | RevWalk walk = new RevWalk(r);
|
| | | ObjectId object = r.resolve(Constants.HEAD);
|
| | | ObjectId object = r.resolve(objectId);
|
| | | RevCommit lastCommit = walk.parseCommit(object);
|
| | | walk.markStart(lastCommit);
|
| | |
|
| | |
| | | int diffDays = (lastCommit.getCommitTime() - firstCommit.getCommitTime())
|
| | | / (60 * 60 * 24);
|
| | | total.duration = diffDays;
|
| | | if (diffDays <= 90) {
|
| | | if (diffDays <= 365) {
|
| | | // Days
|
| | | df = new SimpleDateFormat("yyyy-MM-dd");
|
| | | } else if (diffDays > 90 && diffDays < 365) {
|
| | | // Weeks
|
| | | df = new SimpleDateFormat("yyyy-MM (w)");
|
| | | } else {
|
| | | // Months
|
| | | df = new SimpleDateFormat("yyyy-MM");
|
| | |
| | | return metrics;
|
| | | }
|
| | |
|
| | | public static List<Metric> getAuthorMetrics(Repository r, boolean byEmail) {
|
| | | public static List<Metric> getAuthorMetrics(Repository r, String objectId, boolean byEmail) {
|
| | | final Map<String, Metric> metricMap = new HashMap<String, Metric>();
|
| | |
|
| | | if (StringUtils.isEmpty(objectId)) {
|
| | | objectId = Constants.HEAD;
|
| | | }
|
| | | if (JGitUtils.hasCommits(r)) {
|
| | | try {
|
| | | RevWalk walk = new RevWalk(r);
|
| | | ObjectId object = r.resolve(Constants.HEAD);
|
| | | ObjectId object = r.resolve(objectId);
|
| | | RevCommit lastCommit = walk.parseCommit(object);
|
| | | walk.markStart(lastCommit);
|
| | |
|
| | |
| | | gb.deletion = deletion
|
| | | gb.rename = rename
|
| | | gb.metrics = metrics
|
| | | gb.stats = stats
|
| | | gb.markdown = markdown
|
| | | gb.changedFiles = changed files
|
| | | gb.filesAdded = {0} files added
|
| | |
| | | gb.nameDescription = use '/' to group repositories. e.g. libraries/mycoollib.git
|
| | | gb.ownerDescription = the owner may edit repository settings
|
| | | gb.blob = blob |
| | | gb.commitActivityTrend = commit activity trend
|
| | | gb.commitActivityDOW = commit activity by day of week
|
| | | gb.commitActivityAuthors = primary authors by commit activity |
| | |
| | |
|
| | | <body>
|
| | | <wicket:extend>
|
| | | <h2>Commit Activity</h2>
|
| | | <div style="padding-top:10px;">
|
| | | <!-- branch name -->
|
| | | <div><span class="metricsTitle" wicket:id="branchTitle"></span></div>
|
| | | |
| | | <!-- placeholder for more info -->
|
| | | <div style="float:right;width:200px;text-align: left;">
|
| | | </div>
|
| | |
|
| | | <!-- branch stats -->
|
| | | <h2><wicket:message key="gb.stats"></wicket:message></h2>
|
| | | <span wicket:id="branchStats"></span>
|
| | | |
| | | <!-- commit activity trend -->
|
| | | <h2><wicket:message key="gb.commitActivityTrend"></wicket:message></h2>
|
| | | <div><img wicket:id="commitsChart" /></div>
|
| | |
|
| | | <h2>Commit Activity by Day of Week</h2>
|
| | | <!-- commit activity by day of week -->
|
| | | <h2><wicket:message key="gb.commitActivityDOW"></wicket:message></h2>
|
| | | <div><img wicket:id="dayOfWeekChart" /></div>
|
| | |
|
| | | <h2>Commit Activity by Time of Day</h2>
|
| | | <div><img wicket:id="timeOfDayChart" /></div>
|
| | |
|
| | | <h2>Most Prolific Authors</h2>
|
| | | <!-- commit activity by primary authors -->
|
| | | <h2><wicket:message key="gb.commitActivityAuthors"></wicket:message></h2>
|
| | | <div><img wicket:id="authorsChart" /></div>
|
| | |
|
| | | </div>
|
| | | </wicket:extend>
|
| | | </body>
|
| | | </html> |
| | |
| | |
|
| | | import java.awt.Color;
|
| | | import java.awt.Dimension;
|
| | | import java.text.ParseException;
|
| | | import java.text.MessageFormat;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.wicket.PageParameters;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.wicketstuff.googlecharts.Chart;
|
| | | import org.wicketstuff.googlecharts.ChartAxis;
|
| | |
| | |
|
| | | import com.gitblit.models.Metric;
|
| | | import com.gitblit.utils.MetricUtils;
|
| | | import com.gitblit.utils.TimeUtils;
|
| | | import com.gitblit.wicket.WicketUtils;
|
| | |
|
| | | public class MetricsPage extends RepositoryPage {
|
| | |
| | | public MetricsPage(PageParameters params) {
|
| | | super(params);
|
| | | Repository r = getRepository();
|
| | | insertLinePlot("commitsChart", MetricUtils.getDateMetrics(r, false, null));
|
| | | insertBarPlot("dayOfWeekChart", getDayOfWeekMetrics(r));
|
| | | insertLinePlot("timeOfDayChart", getTimeOfDayMetrics(r));
|
| | | insertPieChart("authorsChart", getAuthorMetrics(r));
|
| | | add(new Label("branchTitle", objectId));
|
| | | Metric metricsTotal = null;
|
| | | List<Metric> metrics = MetricUtils.getDateMetrics(r, objectId, true, null);
|
| | | 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, metricsTotal.tag,
|
| | | TimeUtils.duration(metricsTotal.duration))));
|
| | | }
|
| | | insertLinePlot("commitsChart", metrics);
|
| | | insertBarPlot("dayOfWeekChart", getDayOfWeekMetrics(r, objectId));
|
| | | insertPieChart("authorsChart", getAuthorMetrics(r, objectId));
|
| | | }
|
| | |
|
| | | private void insertLinePlot(String wicketId, List<Metric> metrics) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private List<Metric> getDayOfWeekMetrics(Repository repository) {
|
| | | List<Metric> list = MetricUtils.getDateMetrics(repository, false, "E");
|
| | | private List<Metric> getDayOfWeekMetrics(Repository repository, String objectId) {
|
| | | List<Metric> list = MetricUtils.getDateMetrics(repository, objectId, false, "E");
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("E");
|
| | | Calendar cal = Calendar.getInstance();
|
| | |
|
| | |
| | | return sorted;
|
| | | }
|
| | |
|
| | | 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 = MetricUtils.getDateMetrics(repository, false, "yyyy-MM-dd HH:mm");
|
| | | Calendar cal = Calendar.getInstance();
|
| | |
|
| | | for (Metric metric : list) {
|
| | | try {
|
| | | Date date = sdf.parse(metric.name);
|
| | | cal.setTime(date);
|
| | | double y = cal.get(Calendar.HOUR_OF_DAY) + (cal.get(Calendar.MINUTE) / 60d);
|
| | | metric.duration = (int) (date.getTime() / 60000L);
|
| | | metric.count = y;
|
| | | metric.name = ndf.format(date);
|
| | | } catch (ParseException p) {
|
| | | }
|
| | | }
|
| | | return list;
|
| | | }
|
| | |
|
| | | private List<Metric> getAuthorMetrics(Repository repository) {
|
| | | List<Metric> authors = MetricUtils.getAuthorMetrics(repository, true);
|
| | | private List<Metric> getAuthorMetrics(Repository repository, String objectId) {
|
| | | List<Metric> authors = MetricUtils.getAuthorMetrics(repository, objectId, true);
|
| | | Collections.sort(authors, new Comparator<Metric>() {
|
| | | @Override
|
| | | public int compare(Metric o1, Metric o2) {
|
| | |
| | |
|
| | | <!-- 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="metrics"><wicket:message key="gb.metrics"></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> <span wicket:id="extra"><span wicket:id="extraSeparator"></span><span wicket:id="extraLink"></span></span>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | |
| | | put("branches", "gb.branches");
|
| | | put("tags", "gb.tags");
|
| | | put("tree", "gb.tree");
|
| | | put("metrics", "gb.metrics");
|
| | | put("tickets", "gb.tickets");
|
| | | put("edit", "gb.edit");
|
| | | }
|
| | |
| | | add(new BookmarkablePageLink<Void>("tags", TagsPage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | | add(new BookmarkablePageLink<Void>("tree", TreePage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | | add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class,
|
| | | WicketUtils.newRepositoryParameter(repositoryName)));
|
| | |
|
| | | // per-repository extra page links
|
| | |
| | | <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.metrics">[metrics]</wicket:message></th><td><span wicket:id="repositoryMetrics">[repository metrics]</span></td></tr>
|
| | | <tr><th><wicket:message key="gb.stats">[stats]</wicket:message></th><td><span wicket:id="branchStats">[branch stats]</span> <span class="link"><a wicket:id="metrics"><wicket:message key="gb.metrics">[metrics]</wicket:message></a></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>
|
| | |
| | |
|
| | | import org.apache.wicket.PageParameters;
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.link.BookmarkablePageLink;
|
| | | import org.apache.wicket.protocol.http.WebRequest;
|
| | | import org.eclipse.jgit.lib.Repository;
|
| | | import org.eclipse.jgit.revwalk.RevCommit;
|
| | |
| | | List<Metric> metrics = null;
|
| | | Metric metricsTotal = null;
|
| | | if (GitBlit.getBoolean(Keys.web.generateActivityGraph, true)) {
|
| | | metrics = MetricUtils.getDateMetrics(r, true, null);
|
| | | metrics = MetricUtils.getDateMetrics(r, null, true, null);
|
| | | metricsTotal = metrics.remove(0);
|
| | | }
|
| | |
|
| | |
| | | add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r),
|
| | | getTimeZone()));
|
| | | if (metricsTotal == null) {
|
| | | add(new Label("repositoryMetrics", ""));
|
| | | add(new Label("branchStats", "")); |
| | | } else {
|
| | | add(new Label("repositoryMetrics", MessageFormat.format(
|
| | | add(new Label("branchStats", MessageFormat.format(
|
| | | "{0} commits and {1} tags in {2}", metricsTotal.count, metricsTotal.tag,
|
| | | TimeUtils.duration(metricsTotal.duration))));
|
| | | }
|
| | | add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
|
| | |
|
| | | List<String> repositoryUrls = new ArrayList<String>();
|
| | |
|
| | |
| | | .setEscapeModelStrings(false));
|
| | |
|
| | | add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));
|
| | | add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));
|
| | | add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs));
|
| | | add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
|
| | | add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs).hideIfEmpty());
|
| | |
|
| | | if (getRepositoryModel().showReadme) {
|
| | | String htmlText = null;
|
| | |
| | | <td><span wicket:id="branchName">[branch name]</span></td>
|
| | | <td><span wicket:id="branchType">[branch type]</span></td>
|
| | | <td class="rightAlign">
|
| | | <span class="link">
|
| | | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>
|
| | | </span> |
| | | <span wicket:id="branchLinks"></span>
|
| | | </td>
|
| | | </tr>
|
| | | </tbody>
|
| | |
| | |
|
| | | <div wicket:id="allBranches">[all branches]</div>
|
| | |
|
| | | <!-- branch page links -->
|
| | | <wicket:fragment wicket:id="branchPageLinks">
|
| | | <span class="link">
|
| | | <a wicket:id="log"><wicket:message key="gb.log"></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:fragment>
|
| | |
|
| | | <!-- branch panel links -->
|
| | | <wicket:fragment wicket:id="branchPanelLinks">
|
| | | <span class="link">
|
| | | <a wicket:id="log"><wicket:message key="gb.log"></wicket:message></a> | <a wicket:id="tree"><wicket:message key="gb.tree"></wicket:message></a>
|
| | | </span>
|
| | | </wicket:fragment>
|
| | | |
| | | </wicket:panel>
|
| | | </body>
|
| | | </html> |
| | |
| | |
|
| | | import org.apache.wicket.markup.html.basic.Label;
|
| | | import org.apache.wicket.markup.html.link.BookmarkablePageLink;
|
| | | import org.apache.wicket.markup.html.panel.Fragment;
|
| | | import org.apache.wicket.markup.repeater.Item;
|
| | | import org.apache.wicket.markup.repeater.data.DataView;
|
| | | import org.apache.wicket.markup.repeater.data.ListDataProvider;
|
| | |
| | | import com.gitblit.wicket.WicketUtils;
|
| | | import com.gitblit.wicket.pages.BranchesPage;
|
| | | import com.gitblit.wicket.pages.LogPage;
|
| | | import com.gitblit.wicket.pages.MetricsPage;
|
| | | import com.gitblit.wicket.pages.SummaryPage;
|
| | | import com.gitblit.wicket.pages.TreePage;
|
| | |
|
| | | public class BranchesPanel extends BasePanel {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | private final boolean hasBranches;
|
| | |
|
| | | public BranchesPanel(String wicketId, final RepositoryModel model, Repository r,
|
| | | final int maxCount) {
|
| | |
| | | item.add(new Label("branchType", remote ? getString("gb.remote")
|
| | | : getString("gb.local")).setVisible(maxCount <= 0));
|
| | |
|
| | | item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils
|
| | | if (maxCount <= 0) {
|
| | | Fragment fragment = new Fragment("branchLinks", "branchPageLinks", this);
|
| | | fragment.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils
|
| | | .newObjectParameter(model.name, entry.getName())));
|
| | | item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils
|
| | | fragment.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils
|
| | | .newObjectParameter(model.name, entry.getName())));
|
| | |
|
| | | fragment.add(new BookmarkablePageLink<Void>("metrics", MetricsPage.class,
|
| | | WicketUtils.newObjectParameter(model.name, entry.getName())));
|
| | | item.add(fragment);
|
| | | } else {
|
| | | Fragment fragment = new Fragment("branchLinks", "branchPanelLinks", this);
|
| | | fragment.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils
|
| | | .newObjectParameter(model.name, entry.getName())));
|
| | | fragment.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils
|
| | | .newObjectParameter(model.name, entry.getName())));
|
| | | item.add(fragment);
|
| | | }
|
| | | WicketUtils.setAlternatingBackground(item, counter);
|
| | | counter++;
|
| | | }
|
| | |
| | | add(new LinkPanel("allBranches", "link", new StringResourceModel("gb.allBranches",
|
| | | this, null), BranchesPage.class, WicketUtils.newRepositoryParameter(model.name)));
|
| | | }
|
| | | // We always have 1 branch
|
| | | hasBranches = branches.size() > 1;
|
| | | }
|
| | |
|
| | | public BranchesPanel hideIfEmpty() {
|
| | | setVisible(hasBranches);
|
| | | return this;
|
| | | }
|
| | | }
|
| | |
| | | Class<? extends RepositoryPage> linkClass = CommitPage.class;
|
| | | String cssClass = "";
|
| | | if (name.startsWith(Constants.R_HEADS)) {
|
| | | // local head
|
| | | // local branch
|
| | | linkClass = LogPage.class;
|
| | | name = name.substring(Constants.R_HEADS.length());
|
| | | cssClass = "headRef";
|
| | | cssClass = "localBranch";
|
| | | } else if (name.equals(Constants.HEAD)) {
|
| | | // local head
|
| | | linkClass = LogPage.class;
|
| | | cssClass = "headRef";
|
| | | } else if (name.startsWith(Constants.R_REMOTES)) {
|
| | | // remote head
|
| | | // remote branch
|
| | | linkClass = LogPage.class;
|
| | | name = name.substring(Constants.R_REMOTES.length());
|
| | | cssClass = "remoteRef";
|
| | | cssClass = "remoteBranch";
|
| | | } else if (name.startsWith(Constants.R_TAGS)) {
|
| | | // tag
|
| | | if (entry.isAnnotatedTag()) {
|
| | |
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | private final boolean hasTags;
|
| | |
|
| | | public TagsPanel(String wicketId, final String repositoryName, Repository r, final int maxCount) {
|
| | | super(wicketId);
|
| | |
|
| | |
| | | add(new LinkPanel("allTags", "link", new StringResourceModel("gb.allTags", this, null),
|
| | | TagsPage.class, WicketUtils.newRepositoryParameter(repositoryName)));
|
| | | }
|
| | | |
| | | hasTags = tags.size() > 0;
|
| | | }
|
| | | |
| | | public TagsPanel hideIfEmpty() {
|
| | | setVisible(hasTags);
|
| | | return this;
|
| | | }
|
| | | }
|
| | |
| | | width: 13em;
|
| | | }
|
| | |
|
| | | span .tagRef, span .headRef, span .remoteRef, span .otherRef { |
| | | span.metricsTitle {
|
| | | font-size: 2em;
|
| | | }
|
| | |
|
| | | span .tagRef, span .headRef, span .localBranch, span .remoteBranch, span .otherRef { |
| | | padding: 0px 3px;
|
| | | margin-right:2px;
|
| | | font-family: sans-serif;
|
| | |
| | | color: black;
|
| | | }
|
| | |
|
| | | span .tagRef a span, span .headRef a span, span .remoteRef a span, span .otherRef a span {
|
| | | span .tagRef a span, span .headRef a span, span .localBranch a span, span .remoteBranch a span, span .otherRef a span {
|
| | | font-size: 9px;
|
| | | }
|
| | |
|
| | | span .tagRef a, span .headRef a, span .remoteRef a, span .otherRef a {
|
| | | span .tagRef a, span .headRef a, span .localBranch a, span .remoteBranch a, span .otherRef a {
|
| | | text-decoration: none;
|
| | | color: black !important;
|
| | | }
|
| | |
|
| | | span .tagRef a:hover, span .headRef a:hover, span .remoteRef a:hover, span .otherRef a:hover {
|
| | | span .tagRef a:hover, span .headRef a:hover, span .localBranch a:hover, span .remoteBranch a:hover, span .otherRef a:hover {
|
| | | color: black !important;
|
| | | text-decoration: underline;
|
| | | }
|
| | |
|
| | | span .otherRef {
|
| | | background-color: #ffaaff;
|
| | | border-color: #ff00ee;
|
| | | background-color: #80ccdd;
|
| | | border-color: #80aaaa; |
| | | }
|
| | |
|
| | | span .remoteRef {
|
| | | span .remoteBranch {
|
| | | background-color: #cAc2f5;
|
| | | border-color: #6c6cbf;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | span .headRef {
|
| | | background-color: #ffaaff;
|
| | | border-color: #ff00ee;
|
| | | }
|
| | |
|
| | | span .localBranch {
|
| | | background-color: #ccffcc;
|
| | | border-color: #00cc33;
|
| | | }
|
| | |
| | |
|
| | | public void testMetrics() throws Exception {
|
| | | Repository repository = GitBlitSuite.getHelloworldRepository();
|
| | | List<Metric> metrics = MetricUtils.getDateMetrics(repository, true, null);
|
| | | List<Metric> metrics = MetricUtils.getDateMetrics(repository, null, true, null);
|
| | | repository.close();
|
| | | assertTrue("No date metrics found!", metrics.size() > 0);
|
| | | }
|
| | |
|
| | | public void testAuthorMetrics() throws Exception {
|
| | | Repository repository = GitBlitSuite.getHelloworldRepository();
|
| | | List<Metric> byEmail = MetricUtils.getAuthorMetrics(repository, true);
|
| | | List<Metric> byName = MetricUtils.getAuthorMetrics(repository, false);
|
| | | List<Metric> byEmail = MetricUtils.getAuthorMetrics(repository, null, true);
|
| | | List<Metric> byName = MetricUtils.getAuthorMetrics(repository, null, false);
|
| | | repository.close();
|
| | | assertTrue("No author metrics found!", byEmail.size() == 9);
|
| | | assertTrue("No author metrics found!", byName.size() == 8);
|