Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
Project
Project
Details
Activity
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
chaonan
unify_api2
Commits
1a278263
Commit
1a278263
authored
May 12, 2023
by
wang.wenrong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wwr' into 'develop'
fix_2s_downloads See merge request
!44
parents
032a739b
ad031b1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
scope_operations_pds.py
unify_api/modules/anshiu/procedures/scope_operations_pds.py
+25
-19
scope_operations_serv.py
unify_api/modules/anshiu/service/scope_operations_serv.py
+1
-1
No files found.
unify_api/modules/anshiu/procedures/scope_operations_pds.py
View file @
1a278263
import
asyncio
import
datetime
import
datetime
import
json
import
json
import
math
import
math
...
@@ -73,31 +74,36 @@ async def get_scope_list_by_pid(pids, start_dt, end_dt, scope_g="2s"):
...
@@ -73,31 +74,36 @@ async def get_scope_list_by_pid(pids, start_dt, end_dt, scope_g="2s"):
scope_list
=
[]
scope_list
=
[]
starttime_wm
=
datetime
.
datetime
.
now
()
starttime_wm
=
datetime
.
datetime
.
now
()
print
(
f
'起始时间:{starttime_wm}'
)
print
(
f
'起始时间:{starttime_wm}'
)
task_list
=
[]
for
scope_data
in
scope_url_data
:
for
scope_data
in
scope_url_data
:
try
:
try
:
async
with
QsClient
()
as
qs
:
url
=
scope_data
.
get
(
"url"
)
url
=
scope_data
.
get
(
"url"
)
task_list
.
append
(
get_qs_datas
(
url
))
wave_data
=
await
qs
.
get_object
(
url
)
[
scope_list
.
append
({
"datetime"
:
scope_data
[
'datetime'
],
"ua"
:
wave_data
[
'ua'
][
i
],
"ub"
:
wave_data
[
'ub'
][
i
],
"uc"
:
wave_data
[
'uc'
][
i
],
"ia"
:
wave_data
[
'ia'
][
i
],
"ib"
:
wave_data
[
'ib'
][
i
],
"ic"
:
wave_data
[
'ic'
][
i
],
"lc"
:
wave_data
[
'lc'
][
i
],
"pttl"
:
wave_data
[
'pttl'
][
i
]})
for
i
in
range
(
len
(
wave_data
.
get
(
'ua'
)))]
# for i in range(len(wave_data['ua'])):
# a_dict = dict(zip(wave_data.keys(),
# list(zip(*wave_data.values()))[i]))
# a_dict["datetime"] = scope_data['datetime']
# scope_list.append(a_dict)
except
Exception
as
e
:
except
Exception
as
e
:
LOGGER
.
error
(
f
"scope_detail_service error message:{str(e)}"
)
LOGGER
.
error
(
f
"scope_detail_service error message:{str(e)}"
)
return
[]
return
[]
qs_dats
=
await
asyncio
.
gather
(
*
task_list
)
qs_data_map
=
{
data
[
0
]:
data
[
1
]
for
data
in
qs_dats
}
for
scope_data
in
scope_url_data
:
url
=
scope_data
.
get
(
"url"
)
wave_data
=
qs_data_map
[
url
]
[
scope_list
.
append
({
"datetime"
:
scope_data
[
'datetime'
],
"ua"
:
wave_data
[
'ua'
][
i
],
"ub"
:
wave_data
[
'ub'
][
i
],
"uc"
:
wave_data
[
'uc'
][
i
],
"ia"
:
wave_data
[
'ia'
][
i
],
"ib"
:
wave_data
[
'ib'
][
i
],
"ic"
:
wave_data
[
'ic'
][
i
],
"lc"
:
wave_data
[
'lc'
][
i
],
"pttl"
:
wave_data
[
'pttl'
][
i
]})
for
i
in
range
(
len
(
wave_data
.
get
(
'ua'
)))]
end_time_wm
=
datetime
.
datetime
.
now
()
end_time_wm
=
datetime
.
datetime
.
now
()
print
(
f
'结束时间:{end_time_wm}'
)
print
(
f
'结束时间:{end_time_wm}'
)
return
scope_list
return
scope_list
async
def
get_qs_datas
(
url
):
async
with
QsClient
()
as
qs
:
wave_data
=
await
qs
.
get_object
(
url
)
return
url
,
wave_data
unify_api/modules/anshiu/service/scope_operations_serv.py
View file @
1a278263
...
@@ -510,7 +510,7 @@ async def scope_detail_service(event_id):
...
@@ -510,7 +510,7 @@ async def scope_detail_service(event_id):
wave_data
=
await
qs
.
get_object
(
url
)
wave_data
=
await
qs
.
get_object
(
url
)
except
Exception
as
e
:
except
Exception
as
e
:
LOGGER
.
error
(
f
"scope_detail_service error message:{str(e)}"
)
LOGGER
.
error
(
f
"scope_detail_service error message:{str(e)}"
)
return
{},
[],
[],
[],
[]
,
[],
[],
[],
[]
return
{},
[],
[],
[],
[]
# 录波颗粒度
# 录波颗粒度
scope_g
=
scope_data
.
get
(
"scope_g"
)
scope_g
=
scope_data
.
get
(
"scope_g"
)
if
ctnum
==
2
:
if
ctnum
==
2
:
...
...
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