Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dataquality_doc
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王东
dataquality_doc
Commits
e4e4bec3
Commit
e4e4bec3
authored
Aug 17, 2022
by
王东
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
指标计算承保字段调整
parent
cd20937b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
58 deletions
+58
-58
RZ_DM/RZ_DM_QUANTILE.sql
RZ_DM/RZ_DM_QUANTILE.sql
+34
-39
RZ_DM/RZ_DM_RUNSTATUS.sql
RZ_DM/RZ_DM_RUNSTATUS.sql
+24
-19
数据模型表定义.xlsx
数据模型表定义.xlsx
+0
-0
No files found.
RZ_DM/RZ_DM_QUANTILE.sql
View file @
e4e4bec3
-- RZ_DM_QUANTILE ZB_DM_单位时间内访问时间排序
-- RZ_DM_QUANTILE ZB_DM_单位时间内访问时间排序
-- 视图
-- step1:
-- 接口汇总
CREATE
TEMPORARY
VIEW
VIEW_RZ_DM_QUANTILE
AS
select
d1
.
`applicationName`
as
`applicationname`
,
d1
.
`agentId`
as
`agentid`
,
cast
(
tumble_end
(
d1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`time`
,
CastToTagIndexUDF
(
LISTAGG
(
d1
.
`elapsed`
,
';'
)
)
as
`quantile`
-- 拼接
,
cast
(
tumble_start
(
d1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`createtime`
from
(
select
`applicationName`
,
`agentId`
,
`endPoint`
,
`rpc`
,
`startTime`
,
`endTime`
,
`elapsed`
,
`status`
,
`row_time`
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
)
d1
where
d1
.
status
=
'200'
and
RIGHT
(
d1
.
`rpc`
,
3
)
not
in
(
'.js'
)
and
RIGHT
(
d1
.
`rpc`
,
4
)
not
in
(
'.jpg'
,
'.ico'
,
'.css'
,
'.ttf'
,
'.png'
,
'.PNG'
,
'.JPG'
,
'.txt'
,
'.mp4'
,
'.mp3'
,
'.pdf'
,
'.dwr'
)
and
RIGHT
(
d1
.
`rpc`
,
5
)
not
in
(
'.json'
,
'.html'
,
'.less'
,
'.jpeg'
)
and
RIGHT
(
d1
.
`rpc`
,
6
)
not
in
(
'.woff2'
)
group
by
d1
.
`applicationName`
,
d1
.
`agentId`
,
tumble
(
d1
.
row_time
,
interval
'1'
minute
)
;
-- QUANTILE_AGENTID 单位时间内访问时间排序按应用统计
-- QUANTILE_AGENTID 单位时间内访问时间排序按应用统计
insert
into
RZ_DM
.
RZ_DM_KAFKA
.
QUANTILE_AGENTID
insert
into
RZ_DM
.
RZ_DM_KAFKA
.
QUANTILE_AGENTID
...
@@ -49,7 +12,24 @@ SELECT
...
@@ -49,7 +12,24 @@ SELECT
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
2
)
as
`quantile95`
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
2
)
as
`quantile95`
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
3
)
as
`quantile99`
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
3
)
as
`quantile99`
,
s1
.
`createtime`
as
`createtime`
,
s1
.
`createtime`
as
`createtime`
from
VIEW_RZ_DM_QUANTILE
s1
from
(
select
d1
.
`applicationName`
as
`applicationname`
,
d1
.
`agentId`
as
`agentid`
,
DATE_FORMAT
(
tumble_end
(
d1
.
row_time
,
interval
'1'
minute
)
,
'yyyy-MM-dd HH:mm:ss'
)
as
`time`
,
CastToTagIndexUDF
(
LISTAGG
(
d1
.
`elapsed`
,
';'
)
)
as
`quantile`
-- 拼接
,
cast
(
DateTimeToLongUDF
(
tumble_start
(
d1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`createtime`
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
d1
where
UPPER
(
RIGHT
(
d1
.
`rpc`
,
3
))
not
in
(
'.JS'
)
and
UPPER
(
RIGHT
(
d1
.
`rpc`
,
4
))
not
in
(
'.JPG'
,
'.ICO'
,
'.CSS'
,
'.TTF'
,
'.PNG'
,
'.PNG'
,
'.JPG'
,
'.TXT'
,
'.MP4'
,
'.MP3'
,
'.PDF'
,
'.DWR'
)
and
UPPER
(
RIGHT
(
d1
.
`rpc`
,
5
))
not
in
(
'.JSON'
,
'.HTML'
,
'.LESS'
,
'.JPEG'
)
and
UPPER
(
RIGHT
(
d1
.
`rpc`
,
6
))
not
in
(
'.WOFF2'
)
group
by
d1
.
`applicationName`
,
d1
.
`agentId`
,
tumble
(
d1
.
row_time
,
interval
'1'
minute
)
)
s1
;
;
...
@@ -63,7 +43,22 @@ SELECT
...
@@ -63,7 +43,22 @@ SELECT
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
2
)
as
`quantile95`
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
2
)
as
`quantile95`
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
3
)
as
`quantile99`
,
SPLIT_INDEX
(
s1
.
`quantile`
,
';'
,
3
)
as
`quantile99`
,
s1
.
`createtime`
as
`createtime`
,
s1
.
`createtime`
as
`createtime`
from
VIEW_RZ_DM_QUANTILE
s1
from
(
select
d1
.
`applicationName`
as
`applicationname`
,
DATE_FORMAT
(
tumble_end
(
d1
.
row_time
,
interval
'1'
minute
)
,
'yyyy-MM-dd HH:mm:ss'
)
as
`time`
,
CastToTagIndexUDF
(
LISTAGG
(
d1
.
`elapsed`
,
';'
)
)
as
`quantile`
-- 拼接
,
cast
(
DateTimeToLongUDF
(
tumble_start
(
d1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`createtime`
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
d1
where
UPPER
(
RIGHT
(
d1
.
`rpc`
,
3
))
not
in
(
'.JS'
)
and
UPPER
(
RIGHT
(
d1
.
`rpc`
,
4
))
not
in
(
'.JPG'
,
'.ICO'
,
'.CSS'
,
'.TTF'
,
'.PNG'
,
'.PNG'
,
'.JPG'
,
'.TXT'
,
'.MP4'
,
'.MP3'
,
'.PDF'
,
'.DWR'
)
and
UPPER
(
RIGHT
(
d1
.
`rpc`
,
5
))
not
in
(
'.JSON'
,
'.HTML'
,
'.LESS'
,
'.JPEG'
)
and
UPPER
(
RIGHT
(
d1
.
`rpc`
,
6
))
not
in
(
'.WOFF2'
)
group
by
d1
.
`applicationName`
,
tumble
(
d1
.
row_time
,
interval
'1'
minute
)
)
s1
;
;
...
...
RZ_DM/RZ_DM_RUNSTATUS.sql
View file @
e4e4bec3
...
@@ -7,13 +7,18 @@ select
...
@@ -7,13 +7,18 @@ select
,
s1
.
agentId
as
`agentid`
,
s1
.
agentId
as
`agentid`
,
s1
.
endPoint
as
`endpoint`
,
s1
.
endPoint
as
`endpoint`
,
s1
.
rpc
as
`rpc`
,
s1
.
rpc
as
`rpc`
,
cast
(
tumble_end
(
s1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`time`
,
DATE_FORMAT
(
tumble_end
(
d1
.
row_time
,
interval
'1'
minute
)
,
'yyyy-MM-dd HH:mm:ss'
)
as
`time`
,
cast
(
AVG
(
cast
(
s1
.
elapsed
as
decimal
(
18
,
2
))
)
as
varchar
)
as
`averageelapsed`
,
cast
(
AVG
(
cast
(
s1
.
elapsed
as
decimal
(
18
,
2
))
)
as
varchar
)
as
`averageelapsed`
,
cast
(
sum
(
1
)
as
varchar
)
as
`total`
,
cast
(
sum
(
1
)
as
varchar
)
as
`total`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
,
1
,
0
))
as
varchar
)
as
`suctotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
,
1
,
0
))
as
varchar
)
as
`suctotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
is
not
true
,
1
,
0
))
as
varchar
)
as
`errortotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
is
not
true
,
1
,
0
))
as
varchar
)
as
`errortotal`
,
cast
(
tumble_start
(
s1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`createtime`
,
cast
(
DateTimeToLongUDF
(
tumble_start
(
d1
.
row_time
,
interval
'1'
minute
)
)
as
varchar
)
as
`createtime`
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
s1
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
s1
where
UPPER
(
RIGHT
(
s1
.
`rpc`
,
3
))
not
in
(
'.JS'
)
and
UPPER
(
RIGHT
(
s1
.
`rpc`
,
4
))
not
in
(
'.JPG'
,
'.ICO'
,
'.CSS'
,
'.TTF'
,
'.PNG'
,
'.PNG'
,
'.JPG'
,
'.TXT'
,
'.MP4'
,
'.MP3'
,
'.PDF'
,
'.DWR'
)
and
UPPER
(
RIGHT
(
s1
.
`rpc`
,
5
))
not
in
(
'.JSON'
,
'.HTML'
,
'.LESS'
,
'.JPEG'
)
and
UPPER
(
RIGHT
(
s1
.
`rpc`
,
6
))
not
in
(
'.WOFF2'
)
group
by
group
by
s1
.
applicationName
s1
.
applicationName
,
s1
.
agentId
,
s1
.
agentId
...
@@ -28,12 +33,12 @@ insert into RZ_DM.RZ_DM_KAFKA.RUNSTATUS_AGENTID
...
@@ -28,12 +33,12 @@ insert into RZ_DM.RZ_DM_KAFKA.RUNSTATUS_AGENTID
select
select
s1
.
applicationName
as
`applicationname`
s1
.
applicationName
as
`applicationname`
,
s1
.
agentId
as
`agentid`
,
s1
.
agentId
as
`agentid`
,
cast
(
tumble_end
(
s1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`time`
,
DATE_FORMAT
(
tumble_end
(
d1
.
row_time
,
interval
'1'
minute
)
,
'yyyy-MM-dd HH:mm:ss'
)
as
`time`
,
cast
(
AVG
(
cast
(
s1
.
elapsed
as
decimal
(
18
,
2
))
)
as
varchar
)
as
`averageelapsed`
,
cast
(
AVG
(
cast
(
s1
.
elapsed
as
decimal
(
18
,
2
))
)
as
varchar
)
as
`averageelapsed`
,
cast
(
sum
(
1
)
as
varchar
)
as
`total`
,
cast
(
sum
(
1
)
as
varchar
)
as
`total`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
,
1
,
0
))
as
varchar
)
as
`suctotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
,
1
,
0
))
as
varchar
)
as
`suctotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
is
not
true
,
1
,
0
))
as
varchar
)
as
`errortotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
is
not
true
,
1
,
0
))
as
varchar
)
as
`errortotal`
,
cast
(
tumble_start
(
s1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`createtime`
,
cast
(
DateTimeToLongUDF
(
tumble_start
(
d1
.
row_time
,
interval
'1'
minute
)
)
as
varchar
)
as
`createtime`
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
s1
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
s1
group
by
group
by
s1
.
applicationName
s1
.
applicationName
...
@@ -46,12 +51,12 @@ group by
...
@@ -46,12 +51,12 @@ group by
insert
into
RZ_DM
.
RZ_DM_KAFKA
.
RUNSTATUS_APP
insert
into
RZ_DM
.
RZ_DM_KAFKA
.
RUNSTATUS_APP
select
select
s1
.
applicationName
as
`applicationname`
s1
.
applicationName
as
`applicationname`
,
cast
(
tumble_end
(
s1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`time`
,
DATE_FORMAT
(
tumble_end
(
d1
.
row_time
,
interval
'1'
minute
)
,
'yyyy-MM-dd HH:mm:ss'
)
as
`time`
,
cast
(
AVG
(
cast
(
s1
.
elapsed
as
decimal
(
18
,
2
))
)
as
varchar
)
as
`averageelapsed`
,
cast
(
AVG
(
cast
(
s1
.
elapsed
as
decimal
(
18
,
2
))
)
as
varchar
)
as
`averageelapsed`
,
cast
(
sum
(
1
)
as
varchar
)
as
`total`
,
cast
(
sum
(
1
)
as
varchar
)
as
`total`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
,
1
,
0
))
as
varchar
)
as
`suctotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
,
1
,
0
))
as
varchar
)
as
`suctotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
is
not
true
,
1
,
0
))
as
varchar
)
as
`errortotal`
,
cast
(
sum
(
if
(
s1
.
status
=
'200'
is
not
true
,
1
,
0
))
as
varchar
)
as
`errortotal`
,
cast
(
tumble_start
(
s1
.
row_time
,
interval
'1'
minute
)
as
varchar
)
as
`createtime`
,
cast
(
DateTimeToLongUDF
(
tumble_start
(
d1
.
row_time
,
interval
'1'
minute
)
)
as
varchar
)
as
`createtime`
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
s1
from
RZ_ODS
.
RZ_ODS_KAFKA
.
RZDATA
s1
group
by
group
by
s1
.
applicationName
s1
.
applicationName
...
...
数据模型表定义.xlsx
View file @
e4e4bec3
No preview for this file type
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