Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
635393b5
Commit
635393b5
authored
Jul 30, 2018
by
msdundar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show one digit after dot in commit_per_day value in charts page.
Closes #26512
parent
87f03f01
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
changelogs/unreleased/floating-avarage-commit-numbers.yml
changelogs/unreleased/floating-avarage-commit-numbers.yml
+5
-0
lib/gitlab/graphs/commits.rb
lib/gitlab/graphs/commits.rb
+1
-1
spec/lib/gitlab/graphs/commits_spec.rb
spec/lib/gitlab/graphs/commits_spec.rb
+1
-1
No files found.
changelogs/unreleased/floating-avarage-commit-numbers.yml
0 → 100644
View file @
635393b5
---
title
:
Show one digit after dot in commit_per_day value in charts page.
merge_request
:
author
:
msdundar
type
:
changed
lib/gitlab/graphs/commits.rb
View file @
635393b5
...
...
@@ -18,7 +18,7 @@ module Gitlab
end
def
commit_per_day
@commit_per_day
||=
@commits
.
size
/
(
@duration
+
1
)
@commit_per_day
||=
(
@commits
.
size
.
to_f
/
(
@duration
+
1
)).
round
(
1
)
end
def
collect_data
...
...
spec/lib/gitlab/graphs/commits_spec.rb
View file @
635393b5
...
...
@@ -29,7 +29,7 @@ describe Gitlab::Graphs::Commits do
context
'with commits from yesterday and today'
do
subject
{
described_class
.
new
([
commit2
,
commit1_yesterday
])
}
describe
'#commit_per_day'
do
it
{
expect
(
subject
.
commit_per_day
).
to
eq
1
}
it
{
expect
(
subject
.
commit_per_day
).
to
eq
0.7
}
end
describe
'#duration'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment