Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
inspect_report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
zhengjinlei
inspect_report
Commits
28cbe4ea
Commit
28cbe4ea
authored
Dec 16, 2019
by
zhengjinlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计任务
parent
909ec7bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
31 deletions
+0
-31
cron.py
src/inspect_report/cron.py
+0
-31
No files found.
src/inspect_report/cron.py
View file @
28cbe4ea
...
@@ -43,20 +43,6 @@ def rule_stat(start_date, end_date):
...
@@ -43,20 +43,6 @@ def rule_stat(start_date, end_date):
'taskId'
:
check
[
'taskId'
],
'sessionId'
:
check
[
'sessionId'
],
'taskId'
:
check
[
'taskId'
],
'sessionId'
:
check
[
'sessionId'
],
'session_table_id'
:
check
[
'id'
]}
'session_table_id'
:
check
[
'id'
]}
rules_list
.
append
(
RulesStat
(
**
rule_obj
))
rules_list
.
append
(
RulesStat
(
**
rule_obj
))
# rd = RulesStat()
# rd.create_date = start_date
# rd.sessionCollectionId = t['sessionCollectionId']
# rd.rule = name
# rd.rule_num = 1
# rd.task = t['name'].split('_')[0]
# rd.agentName = check['agentName']
# rd.customName = check['customName']
# rd.score = check['score']
# rd.remainTime = check['remainTime']
# rd.taskId = check['taskId']
# rd.sessionId = check['sessionId']
# rd.session_table_id = check['id']
# rd.save()
stat_count
+=
1
stat_count
+=
1
logger
.
info
(
'统计数量为:
%
s'
%
stat_count
)
logger
.
info
(
'统计数量为:
%
s'
%
stat_count
)
RulesStat
.
objects
.
bulk_create
(
rules_list
)
RulesStat
.
objects
.
bulk_create
(
rules_list
)
...
@@ -93,21 +79,4 @@ def seat_stat(start_date, end_date):
...
@@ -93,21 +79,4 @@ def seat_stat(start_date, end_date):
seat_obj
=
{
'agentName'
:
k
}
seat_obj
=
{
'agentName'
:
k
}
seat_obj
.
update
(
v
)
seat_obj
.
update
(
v
)
seat_list
.
append
(
SeatStat
(
**
seat_obj
))
seat_list
.
append
(
SeatStat
(
**
seat_obj
))
# seat_condition = {'create_date': start_date, 'agentName': check['agentName']}
# seats = SeatStat.objects.filter(**seat_condition)
# if seats:
# seat = seats[0]
# seat.total_session += 1
# seat.validate_session += 1 if check['violationRuleCount'] > 0 else 0
# seat.save()
# else:
# seat = SeatStat()
# seat.create_date = start_date
# seat.agentName = check['agentName']
# seat.taskId = check['taskId']
# seat.task = t['name'].split('_')[0]
# seat.sessionCollectionId = t['sessionCollectionId']
# seat.total_session = 1
# seat.validate_session = 1 if check['violationRuleCount'] > 0 else 0
# seat.save()
SeatStat
.
objects
.
bulk_create
(
seat_list
)
SeatStat
.
objects
.
bulk_create
(
seat_list
)
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