Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nezha-compute-mengxiangxuan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mengxiangxuan
nezha-compute-mengxiangxuan
Commits
242e5786
Commit
242e5786
authored
Jun 25, 2018
by
mxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
正负反馈
parent
dd6c5ed6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
59 deletions
+57
-59
BlackWhiteNameListRule.java
.../main/java/blackwhitenamelist/BlackWhiteNameListRule.java
+35
-32
CostConvertInfo.java
...sis/src/main/java/blackwhitenamelist/CostConvertInfo.java
+15
-5
Test.java
...auto-diagnosis/src/main/java/blackwhitenamelist/Test.java
+7
-22
No files found.
tuia-auto-diagnosis/src/main/java/blackwhitenamelist/BlackWhiteNameListRule.java
View file @
242e5786
...
@@ -13,59 +13,62 @@ public class BlackWhiteNameListRule {
...
@@ -13,59 +13,62 @@ public class BlackWhiteNameListRule {
CostConvertInfo
costConvertInfo
=
infoList
.
get
(
i
);
CostConvertInfo
costConvertInfo
=
infoList
.
get
(
i
);
String
type
=
costConvertInfo
.
type
;
String
type
=
costConvertInfo
.
type
;
String
tag
=
costConvertInfo
.
tag
;
String
tag
=
costConvertInfo
.
tag
;
String
key
=
costConvertInfo
.
appId
+
"_"
+
costConvertInfo
.
slotId
+
"_"
+
costConvertInfo
.
activityId
+
"_"
+
costConvertInfo
.
orientationId
+
"_"
+
costConvertInfo
.
advertId
;
Integer
grained
=
costConvertInfo
.
grained
;
String
whiteBlackKey
=
costConvertInfo
.
appId
+
"_"
+
costConvertInfo
.
slotId
+
"_"
+
costConvertInfo
.
activityId
+
"_"
+
costConvertInfo
.
orientationId
+
"_"
+
costConvertInfo
.
advertId
;
String
fuseKey
=
costConvertInfo
.
orientationId
+
"_"
+
costConvertInfo
.
advertId
;
Float
costConvertAd
=
costConvertInfo
.
adCostConvert
;
//某广告的全局成本 为空会默认成0 所以条件要>0
long
luanch_cnt
=
costConvertInfo
.
launchCnt
;
//某广告的全局成本
if
(
type
.
equals
(
"day"
)
&&
tag
.
equals
(
"2"
)
&&
grained
==
1
&&
costConvertAd
>
0
)
{
Float
costConvertAd
=
costConvertInfo
.
adCostConvert
;
//某广告的全局成本
long
luanch_cnt
=
costConvertInfo
.
launchCnt
;
Long
costKey1dZ
=
costConvertInfo
.
cost
;
if
(
type
==
"hour"
&&
tag
==
"all"
&&
luanch_cnt
>
5
)
{
Long
convertKey1dZ
=
costConvertInfo
.
convert
;
if
(
convertKey1dZ
==
0
&&
costKey1dZ
>
1000
)
{
nameListMap
.
put
(
fuseKey
,
"fuse_1"
);
}
else
if
(
convertKey1dZ
>
0
)
{
Long
costConvertKey1dZ
=
costKey1dZ
/
convertKey1dZ
;
Float
diffR1dZ
=
costConvertKey1dZ
/
costConvertAd
;
if
(
diffR1dZ
>=
3
)
{
nameListMap
.
put
(
fuseKey
,
"fuse_1"
);
}
}
}
else
if
(
type
.
equals
(
"hour"
)
&&
tag
.
equals
(
"2"
)
&&
grained
==
0
&&
costConvertAd
>
0
)
{
long
luanch_cnt
=
costConvertInfo
.
launchCnt
;
Long
costKey1h
=
costConvertInfo
.
cost
;
Long
costKey1h
=
costConvertInfo
.
cost
;
Long
convertKey1h
=
costConvertInfo
.
convert
;
Long
convertKey1h
=
costConvertInfo
.
convert
;
if
(
convertKey1h
==
0
&&
costKey1h
>
1
.5
*
costConvertAd
)
{
if
(
convertKey1h
==
0
&&
costKey1h
>
1
000
)
{
nameListMap
.
put
(
k
ey
,
"b3_1"
);
nameListMap
.
put
(
whiteBlackK
ey
,
"b3_1"
);
}
}
else
if
(
convertKey1h
>
0
)
{
else
if
(
convertKey1h
>
0
)
{
Long
costConvertKey1h
=
costKey1h
/
convertKey1h
;
Long
costConvertKey1h
=
costKey1h
/
convertKey1h
;
Float
diffR1h
=
costConvertKey1h
/
costConvertAd
;
Float
diffR1h
=
costConvertKey1h
/
costConvertAd
;
if
(
diffR1h
>=
1.5
)
{
if
(
diffR1h
>=
2
)
{
nameListMap
.
put
(
k
ey
,
"b3_1"
);
nameListMap
.
put
(
whiteBlackK
ey
,
"b3_1"
);
}
}
}
}
}
else
if
(
type
==
"day"
&&
tag
==
"all"
&&
luanch_cnt
>
10
)
{
}
else
if
(
type
.
equals
(
"day"
)
&&
tag
.
equals
(
"2"
)
&&
grained
==
0
&&
costConvertAd
>
0
)
{
long
luanch_cnt
=
costConvertInfo
.
launchCnt
;
Long
costKey1d
=
costConvertInfo
.
cost
;
Long
costKey1d
=
costConvertInfo
.
cost
;
Long
convertKey1d
=
costConvertInfo
.
convert
;
Long
convertKey1d
=
costConvertInfo
.
convert
;
if
(
convertKey1d
==
0
&&
costKey1d
>
2.5
*
costConvertAd
&&
costKey1d
<=
3.5
*
costConvertAd
)
{
if
(
convertKey1d
==
0
&&
costKey1d
>
5000
)
{
nameListMap
.
put
(
k
ey
,
"b1_5"
);
nameListMap
.
put
(
whiteBlackK
ey
,
"b1_5"
);
}
}
else
if
(
convertKey1d
==
0
&&
costKey1d
>
2
*
costConvertAd
&&
costKey1d
<=
2.5
*
costConvertAd
)
{
else
if
(
convertKey1d
==
0
&&
costKey1d
>
1000
)
{
nameListMap
.
put
(
k
ey
,
"b2_3"
);
nameListMap
.
put
(
whiteBlackK
ey
,
"b2_3"
);
}
}
else
if
(
convertKey1d
>
0
)
{
else
if
(
convertKey1d
>
0
)
{
Long
costConvertKey1d
=
costKey1d
/
convertKey1d
;
Long
costConvertKey1d
=
costKey1d
/
convertKey1d
;
Float
diffR1d
=
(
costConvertKey1d
-
costConvertAd
)
/
costConvertAd
;
Float
diffR1d
=
costConvertKey1d
/
costConvertAd
;
if
(
diffR1d
>
2.5
&&
diffR1d
<=
3.5
)
{
if
(
diffR1d
>
2.5
&&
diffR1d
<=
3.5
)
{
nameListMap
.
put
(
k
ey
,
"b1_5"
);
nameListMap
.
put
(
whiteBlackK
ey
,
"b1_5"
);
}
else
if
(
diffR1d
>=
2
&&
diffR1d
<
2.5
)
{
}
else
if
(
diffR1d
>=
1.5
&&
diffR1d
<
2.5
)
{
nameListMap
.
put
(
k
ey
,
"b2_3"
);
nameListMap
.
put
(
whiteBlackK
ey
,
"b2_3"
);
}
else
if
(
diffR1d
<
0.5
)
{
}
else
if
(
diffR1d
<
0.5
)
{
nameListMap
.
put
(
k
ey
,
"w_1"
);
nameListMap
.
put
(
whiteBlackK
ey
,
"w_1"
);
}
}
}
}
}
else
if
(
tag
==
"2"
&&
luanch_cnt
>
10
)
{
Long
costKey1hZ
=
costConvertInfo
.
cost
;
Long
convertKey1hZ
=
costConvertInfo
.
convert
;
if
(
convertKey1hZ
==
0
&&
costKey1hZ
>
3.5
*
costConvertAd
)
{
nameListMap
.
put
(
key
,
"fuse_1"
);
}
else
if
(
convertKey1hZ
>
0
)
{
Long
costConvertKey1hZ
=
costKey1hZ
/
convertKey1hZ
;
Float
diffR1hZ
=
costConvertKey1hZ
/
costConvertAd
;
if
(
diffR1hZ
>=
3.5
&&
costKey1hZ
>
100
)
{
nameListMap
.
put
(
key
,
"fuse_1"
);
}
}
}
}
}
}
return
nameListMap
;
return
nameListMap
;
...
...
tuia-auto-diagnosis/src/main/java/blackwhitenamelist/CostConvertInfo.java
View file @
242e5786
...
@@ -8,15 +8,16 @@ public class CostConvertInfo {
...
@@ -8,15 +8,16 @@ public class CostConvertInfo {
String
advertId
;
String
advertId
;
String
type
;
//type=hour:表示小时数据, day :表示1天粒度的指标数据
String
type
;
//type=hour:表示小时数据, day :表示1天粒度的指标数据
String
tag
;
//tag=all :表示所有广告,2:表示走智能匹配的广告
String
tag
;
//tag=all :表示所有广告,2:表示走智能匹配的广告
Long
cost
;
Integer
grained
;
// 0:最细粒度 1:广告配置粒度
Long
convert
;
Long
cost
;
//最细粒度消耗
Long
launchCnt
;
Long
convert
;
//最细粒度转化
Long
launchCnt
;
//最细粒度发券量
Float
adCostConvert
;
//每个广告配置全局成本,读离线数据获取
Float
adCostConvert
;
//每个广告配置全局成本,读离线数据获取
public
CostConvertInfo
()
{
public
CostConvertInfo
()
{
}
}
public
CostConvertInfo
(
String
appId
,
String
slotId
,
String
activityId
,
String
orientationId
,
String
advertId
,
String
type
,
String
tag
,
Long
cost
,
Long
convert
,
Long
launchCnt
,
Float
adCostConvert
)
{
public
CostConvertInfo
(
String
appId
,
String
slotId
,
String
activityId
,
String
orientationId
,
String
advertId
,
String
type
,
String
tag
,
Integer
grained
,
Long
cost
,
Long
convert
,
Long
launchCnt
,
Float
adCostConvert
)
{
this
.
appId
=
appId
;
this
.
appId
=
appId
;
this
.
slotId
=
slotId
;
this
.
slotId
=
slotId
;
this
.
activityId
=
activityId
;
this
.
activityId
=
activityId
;
...
@@ -24,6 +25,7 @@ public class CostConvertInfo {
...
@@ -24,6 +25,7 @@ public class CostConvertInfo {
this
.
advertId
=
advertId
;
this
.
advertId
=
advertId
;
this
.
type
=
type
;
this
.
type
=
type
;
this
.
tag
=
tag
;
this
.
tag
=
tag
;
this
.
grained
=
grained
;
this
.
cost
=
cost
;
this
.
cost
=
cost
;
this
.
convert
=
convert
;
this
.
convert
=
convert
;
this
.
launchCnt
=
launchCnt
;
this
.
launchCnt
=
launchCnt
;
...
@@ -86,6 +88,14 @@ public class CostConvertInfo {
...
@@ -86,6 +88,14 @@ public class CostConvertInfo {
this
.
tag
=
tag
;
this
.
tag
=
tag
;
}
}
public
Integer
getGrained
()
{
return
grained
;
}
public
void
setGrained
(
Integer
grained
)
{
this
.
grained
=
grained
;
}
public
Long
getCost
()
{
public
Long
getCost
()
{
return
cost
;
return
cost
;
}
}
...
@@ -117,4 +127,4 @@ public class CostConvertInfo {
...
@@ -117,4 +127,4 @@ public class CostConvertInfo {
public
void
setAdCostConvert
(
Float
adCostConvert
)
{
public
void
setAdCostConvert
(
Float
adCostConvert
)
{
this
.
adCostConvert
=
adCostConvert
;
this
.
adCostConvert
=
adCostConvert
;
}
}
}
}
\ No newline at end of file
tuia-auto-diagnosis/src/main/java/blackwhitenamelist/Test.java
View file @
242e5786
...
@@ -9,31 +9,16 @@ public class Test {
...
@@ -9,31 +9,16 @@ public class Test {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
CostConvertInfo
costConvertInfo1
=
new
CostConvertInfo
(
CostConvertInfo
costConvertInfo1
=
new
CostConvertInfo
(
"4
6360"
,
"185086"
,
"5255"
,
"27192"
,
"18938
"
,
"4
4474"
,
"8675"
,
"7403"
,
"0"
,
"31320
"
,
"
day"
,
"all"
,
11760L
,
0L
,
140L
,
4886.129
F
"
hour"
,
"2"
,
0
,
1020L
,
0L
,
37L
,
69.37984
F
);
);
CostConvertInfo
costConvertInfo2
=
new
CostConvertInfo
(
"24504"
,
"3440"
,
"246"
,
"33166"
,
"17080"
,
"day"
,
"all"
,
11191L
,
5L
,
450L
,
1789.415
F
CostConvertInfo
costConvertInfo2
=
new
CostConvertInfo
(
"11111"
,
"22222"
,
"5255"
,
"27192"
,
"30886"
,
"day"
,
"2"
,
1
,
2680L
,
0L
,
88888L
,
1677.3059
F
);
);
//
// CostConvertInfo costConvertInfo3= new CostConvertInfo(
// "28168", "1497", "6976", "42337", "28525",
// "day", "all", 25L, 2L, 100L,26.0F
//
// );
// CostConvertInfo costConvertInfo4= new CostConvertInfo(
// "40548", "6244", "5538", "42579", "28629",
// "day", "all", 20L, 8L,22L, 259.0F
//
// );
// CostConvertInfo costConvertInfo5= new CostConvertInfo(
// "23898", "8888", "6826", "42337", "28525",
// "day", "2", 28275L, 64L,300L, 1.0F
//
// );
List
infoList
=
new
ArrayList
();
List
infoList
=
new
ArrayList
();
...
...
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