Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
tas_monitor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2ebcbca4
authored
Aug 01, 2024
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去掉某些没有采集的平台 powell统计过期率的时候去掉旧数据干扰
parent
d8e6d9af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
utils/mongo.py
utils/mongo.py
View file @
2ebcbca4
...
...
@@ -35,7 +35,6 @@ def get_mongo_conf():
filter_pn
=
(
"cdi"
,
"richardsonrfpd"
,
"company"
,
"wpg"
,)
class
MongoOperator
:
def
__init__
(
self
):
...
...
@@ -46,9 +45,9 @@ class MongoOperator:
self
.
db
=
self
.
conn
[
config
[
'database'
]]
# element14 chip1stop ti
self
.
colls
=
(
'alliedelec'
,
'arrow'
,
'avnet'
,
'buerklin'
,
'digikey'
,
'master'
,
'rs'
,
'rochester'
,
'verical'
,
"powell"
,
'
microchip'
,
'tme'
,
'heilind'
,
'maxim'
,
'aipco'
,
'company'
,
'rutronik
'
,
'mouser'
,
'corestaff'
,
'wpg'
,
'szlc'
,
'element14'
,
'
chip1stop'
,
'
future'
,
"nep"
,
"cdi"
,
"nac"
,
"richardsonrfpd"
,
"pui"
)
'verical'
,
"powell"
,
'
tme'
,
'heilind'
,
'maxim'
,
'aipco
'
,
'mouser'
,
'corestaff'
,
'wpg'
,
'szlc'
,
'element14'
,
'future'
,
"nep"
,
"cdi"
,
"nac"
,
"richardsonrfpd"
,)
@staticmethod
def
get_unexpired_time
(
plat
):
...
...
@@ -67,11 +66,18 @@ class MongoOperator:
@staticmethod
def
get_query
(
ts
,
plat
):
expired_query
,
total_query
=
{
'time'
:
{
"$lt"
:
ts
}},
{}
if
plat
not
in
(
'element14'
,
'chip1stop'
,
'future'
):
if
plat
in
(
'element14'
,
'chip1stop'
):
expired_query
=
{
'time'
:
{
"$gt"
:
ts
}}
elif
plat
in
(
"powell"
,):
#powell 里面存在旧数据的需要过滤
expired_query
[
"goods_id"
]
=
{
"$gte"
:
33000494159
}
total_query
[
"goods_id"
]
=
{
"$gte"
:
33000494159
}
expired_query
[
'is_error'
]
=
0
total_query
[
'is_error'
]
=
0
elif
plat
in
(
'element14'
,
'chip1stop'
):
expired_query
=
{
'time'
:
{
"$gt"
:
ts
}}
elif
plat
not
in
(
'element14'
,
'chip1stop'
,
'future'
):
expired_query
[
'is_error'
]
=
0
total_query
[
'is_error'
]
=
0
return
expired_query
,
total_query
@staticmethod
...
...
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