Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a9982762
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a9982762
编写于
11月 21, 2016
作者:
J
James Lopez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added analytics stage serializer and moved some info to the stage classes from the controller
上级
3268e377
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
59 addition
and
0 deletion
+59
-0
app/serializers/analytics_stage_entity.rb
app/serializers/analytics_stage_entity.rb
+12
-0
app/serializers/analytics_stage_serializer.rb
app/serializers/analytics_stage_serializer.rb
+3
-0
lib/gitlab/cycle_analytics/base_stage.rb
lib/gitlab/cycle_analytics/base_stage.rb
+2
-0
lib/gitlab/cycle_analytics/code_stage.rb
lib/gitlab/cycle_analytics/code_stage.rb
+6
-0
lib/gitlab/cycle_analytics/issue_stage.rb
lib/gitlab/cycle_analytics/issue_stage.rb
+6
-0
lib/gitlab/cycle_analytics/plan_stage.rb
lib/gitlab/cycle_analytics/plan_stage.rb
+6
-0
lib/gitlab/cycle_analytics/production_stage.rb
lib/gitlab/cycle_analytics/production_stage.rb
+6
-0
lib/gitlab/cycle_analytics/review_stage.rb
lib/gitlab/cycle_analytics/review_stage.rb
+6
-0
lib/gitlab/cycle_analytics/staging_stage.rb
lib/gitlab/cycle_analytics/staging_stage.rb
+6
-0
lib/gitlab/cycle_analytics/test_stage.rb
lib/gitlab/cycle_analytics/test_stage.rb
+6
-0
未找到文件。
app/serializers/analytics_stage_entity.rb
0 → 100644
浏览文件 @
a9982762
class
AnalyticsStageEntity
<
Grape
::
Entity
include
EntityDateHelper
expose
:stage
,
as: :title
do
|
object
|
object
[
:stage
].
to_s
.
capitalize
end
expose
:description
expose
:median
,
as: :value
do
|
stage
|
stage
[
:median
]
&&
!
stage
[
:median
].
zero?
?
distance_of_time_in_words
(
stage
[
:median
])
:
nil
end
end
app/serializers/analytics_stage_serializer.rb
0 → 100644
浏览文件 @
a9982762
class
AnalyticsStageSerializer
<
BaseSerializer
entity
AnalyticsStageEntity
end
lib/gitlab/cycle_analytics/base_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
BaseStage
attr_reader
:stage
,
:description
def
initialize
(
project
:,
options
:,
stage:
stage
)
@project
=
project
@options
=
options
...
...
lib/gitlab/cycle_analytics/code_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
CodeStage
<
BaseStage
def
initialize
(
*
args
)
super
(
*
args
)
@description
=
"Time until first merge request"
end
def
median
@fetcher
.
calculate_metric
(
:code
,
Issue
::
Metrics
.
arel_table
[
:first_mentioned_in_commit_at
],
...
...
lib/gitlab/cycle_analytics/issue_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
IssueStage
<
BaseStage
def
initialize
(
*
args
)
super
(
*
args
)
@description
=
"Time before an issue gets scheduled"
end
def
median
@fetcher
.
calculate_metric
(
:issue
,
Issue
.
arel_table
[
:created_at
],
...
...
lib/gitlab/cycle_analytics/plan_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
PlanStage
<
BaseStage
def
initialize
(
*
args
)
super
(
*
args
)
@description
=
"Time before an issue starts implementation"
end
def
median
@fetcher
.
calculate_metric
(
:plan
,
[
Issue
::
Metrics
.
arel_table
[
:first_associated_with_milestone_at
],
...
...
lib/gitlab/cycle_analytics/production_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
ProductionStage
<
BaseStage
def
initialize
(
*
args
)
super
(
*
args
)
@description
=
"From issue creation until deploy to production"
end
def
median
@fetcher
.
calculate_metric
(
:production
,
Issue
.
arel_table
[
:created_at
],
...
...
lib/gitlab/cycle_analytics/review_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
ReviewStage
<
BaseStage
def
initialize
(
*
args
)
super
(
*
args
)
@description
=
"Time between merge request creation and merge/close"
end
def
median
@fetcher
.
calculate_metric
(
:review
,
MergeRequest
.
arel_table
[
:created_at
],
...
...
lib/gitlab/cycle_analytics/staging_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
StagingStage
<
BaseStage
def
initialize
(
*
args
)
super
(
*
args
)
@description
=
"From merge request merge until deploy to production"
end
def
median
@fetcher
.
calculate_metric
(
:staging
,
MergeRequest
::
Metrics
.
arel_table
[
:merged_at
],
...
...
lib/gitlab/cycle_analytics/test_stage.rb
浏览文件 @
a9982762
module
Gitlab
module
CycleAnalytics
class
TestStage
<
BaseStage
def
initialize
(
*
args
)
super
(
*
args
)
@description
=
"Total test time for all commits/merges"
end
def
median
@fetcher
.
calculate_metric
(
:test
,
MergeRequest
::
Metrics
.
arel_table
[
:latest_build_started_at
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录