Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
m500-pressure
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
李远洪
m500-pressure
Commits
4b0339f8
Commit
4b0339f8
authored
Aug 31, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了一个bug
parent
3f38bca9
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94564 additions
and
101 deletions
+94564
-101
data/log1.txt
data/log1.txt
+42
-27
data/protocolTools/carData/M202003060520.json
data/protocolTools/carData/M202003060520.json
+0
-1
lib/socket/service/M500PressureServer.py
lib/socket/service/M500PressureServer.py
+66
-63
result.txt
result.txt
+94448
-6
start.py
start.py
+8
-4
No files found.
data/log1.txt
View file @
4b0339f8
[2020-08-21 23:06:57]启动了线程:thread_0车机号:M202003060520
[2020-08-31 12:02:06]启动了线程:thread_0车机号:M202008280000
[2020-08-21 23:07:02]剩余线程数:1
[2020-08-31 12:02:06]启动了线程:thread_1车机号:M202008280001
[2020-08-31 12:02:06]启动了线程:thread_2车机号:M202008280002
[2020-08-31 12:02:06]启动了线程:thread_3车机号:M202008280003
[2020-08-31 12:02:06]启动了线程:thread_4车机号:M202008280004
[2020-08-31 12:02:06]启动了线程:thread_5车机号:M202008280005
[2020-08-31 12:02:06]启动了线程:thread_6车机号:M202008280006
[2020-08-31 12:02:06]启动了线程:thread_7车机号:M202008280007
[2020-08-31 12:02:06]启动了线程:thread_8车机号:M202008280008
[2020-08-31 12:02:06]启动了线程:thread_9车机号:M202008280009
[2020-08-31 12:02:06]启动了线程:thread_10车机号:M202008280010
[2020-08-31 12:02:06]启动了线程:thread_11车机号:M202008280011
[2020-08-31 12:02:06]启动了线程:thread_12车机号:M202008280012
[2020-08-31 12:02:06]启动了线程:thread_13车机号:M202008280013
[2020-08-31 12:02:06]启动了线程:thread_14车机号:M202008280014
[2020-08-31 12:02:06]启动了线程:thread_15车机号:M202008280015
[2020-08-31 12:02:06]启动了线程:thread_16车机号:M202008280016
[2020-08-31 12:02:06]启动了线程:thread_17车机号:M202008280017
[2020-08-31 12:02:06]启动了线程:thread_18车机号:M202008280018
[2020-08-31 12:02:06]启动了线程:thread_19车机号:M202008280019
[2020-08-31 12:02:06]启动了线程:thread_20车机号:M202008280020
[2020-08-31 12:02:06]启动了线程:thread_21车机号:M202008280021
[2020-08-31 12:02:06]启动了线程:thread_22车机号:M202008280022
[2020-08-31 12:02:06]启动了线程:thread_23车机号:M202008280023
[2020-08-31 12:02:06]启动了线程:thread_24车机号:M202008280024
[2020-08-31 12:02:06]启动了线程:thread_25车机号:M202008280025
[2020-08-31 12:02:06]启动了线程:thread_26车机号:M202008280026
[2020-08-31 12:02:06]启动了线程:thread_27车机号:M202008280027
[2020-08-31 12:02:06]启动了线程:thread_28车机号:M202008280028
[2020-08-31 12:02:06]启动了线程:thread_29车机号:M202008280029
[2020-08-31 12:02:06]启动了线程:thread_30车机号:M202008280030
[2020-08-31 12:02:06]启动了线程:thread_31车机号:M202008280031
[2020-08-31 12:02:06]启动了线程:thread_32车机号:M202008280032
[2020-08-31 12:02:06]启动了线程:thread_33车机号:M202008280033
[2020-08-31 12:02:06]启动了线程:thread_34车机号:M202008280034
[2020-08-31 12:02:06]启动了线程:thread_35车机号:M202008280035
[2020-08-31 12:02:06]启动了线程:thread_36车机号:M202008280036
[2020-08-31 12:02:06]启动了线程:thread_37车机号:M202008280037
[2020-08-31 12:02:06]启动了线程:thread_38车机号:M202008280038
[2020-08-31 12:02:06]启动了线程:thread_39车机号:M202008280039
[2020-08-31 12:02:11]剩余线程数:40
成功线程数:0
成功线程数:0
失败线程数:0
失败线程数:0
[2020-08-
21 23:07:07]剩余线程数:1
[2020-08-
31 12:02:16]剩余线程数:40
成功线程数:0
成功线程数:0
失败线程数:0
失败线程数:0
[2020-08-21 23:07:12]剩余线程数:1
成功线程数:0
失败线程数:0
[2020-08-21 23:07:17]剩余线程数:1
成功线程数:0
失败线程数:0
[2020-08-21 23:07:22]剩余线程数:1
成功线程数:0
失败线程数:0
[2020-08-21 23:07:27]剩余线程数:1
成功线程数:0
失败线程数:0
thread_0线程结束
[2020-08-21 23:07:32]剩余线程数:0
成功线程数:1
失败线程数:0
[2020-08-21 23:07:32]剩余线程数:0
----------------------------------------------
开始测试时间:2020-08-21 23:06:57
结束测试时间:2020-08-21 23:07:32
线程总数:1
成功线程数:1
失败线程数:0
设置线程持续时间:30
data/protocolTools/carData/M202003060520.json
deleted
100644 → 0
View file @
3f38bca9
{
"time"
:
{
"dateTime"
:
"2020-08-05 18:21:01"
,
"date"
:
"2020-08-05"
,
"time"
:
"18:21:01"
},
"curDayTravel"
:
{
"todayTotalMilleage"
:
132
,
"todayTotalOil"
:
12
,
"todayTotalTime"
:
6
,
"theMilleage"
:
41052
,
"theOil"
:
3732
,
"theTime"
:
1866
},
"travelData"
:
{
"totalMilleage"
:
41052
,
"totalOil"
:
3732
,
"totalTime"
:
1866
}}
\ No newline at end of file
lib/socket/service/M500PressureServer.py
View file @
4b0339f8
This diff is collapsed.
Click to expand it.
result.txt
View file @
4b0339f8
This diff is collapsed.
Click to expand it.
start.py
View file @
4b0339f8
...
@@ -15,8 +15,9 @@ def writeToFile(path,data,type=1): #1:代表追加 0:代表覆盖
...
@@ -15,8 +15,9 @@ def writeToFile(path,data,type=1): #1:代表追加 0:代表覆盖
with
open
(
path
,
"w"
,
encoding
=
'utf-8'
)
as
fi
:
with
open
(
path
,
"w"
,
encoding
=
'utf-8'
)
as
fi
:
fi
.
write
(
data
)
fi
.
write
(
data
)
carNums
=
1
#模拟器数量
carNums
=
100
#模拟器数量
durTime
=
30
#线程持续的时间
durTime
=
600
#线程持续的时间
startDin
=
202008280000
#开始的车机号
info
=
{}
#存放脚本运行时的信息
info
=
{}
#存放脚本运行时的信息
info
[
"threadsObj"
]
=
{}
#用于运行线程的字典
info
[
"threadsObj"
]
=
{}
#用于运行线程的字典
info
[
"failT"
]
=
{}
#失败线程
info
[
"failT"
]
=
{}
#失败线程
...
@@ -28,10 +29,12 @@ def startSimulaterService():
...
@@ -28,10 +29,12 @@ def startSimulaterService():
timeArray
=
time
.
localtime
(
timeS
)
timeArray
=
time
.
localtime
(
timeS
)
startTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
startTime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
for
i
in
range
(
0
,
carNums
):
for
i
in
range
(
0
,
carNums
):
carId
=
"M"
+
str
(
202003060520
+
i
)
carId
=
"M"
+
str
(
startDin
+
i
)
autoCarObj
=
M500PressureServer
()
autoCarObj
=
M500PressureServer
()
autoCarObj
.
setHost
(
"172.19.7.6"
)
autoCarObj
.
setPort
(
49008
)
autoCarObj
.
setInfo
(
info
)
autoCarObj
.
setInfo
(
info
)
autoCarObj
.
setSendDur
(
5
)
autoCarObj
.
setSendDur
(
1
)
autoCarObj
.
setCarId
(
carId
)
autoCarObj
.
setCarId
(
carId
)
autoCarObj
.
setDurTime
(
durTime
)
autoCarObj
.
setDurTime
(
durTime
)
threadId
=
"thread_"
+
str
(
i
)
threadId
=
"thread_"
+
str
(
i
)
...
@@ -61,6 +64,7 @@ def startSimulaterService():
...
@@ -61,6 +64,7 @@ def startSimulaterService():
timeS
=
int
(
time
.
time
())
timeS
=
int
(
time
.
time
())
timeArray
=
time
.
localtime
(
timeS
)
timeArray
=
time
.
localtime
(
timeS
)
datetime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
datetime
=
time
.
strftime
(
"
%
Y-
%
m-
%
d
%
H:
%
M:
%
S"
,
timeArray
)
threadNums
=
len
(
info
[
"threadsObj"
])
print
(
"剩余线程数:"
+
str
(
threadNums
)
+
"
\n
"
)
print
(
"剩余线程数:"
+
str
(
threadNums
)
+
"
\n
"
)
writeToFile
(
"data/log1.txt"
,
"["
+
datetime
+
"]"
+
"剩余线程数:"
+
str
(
threadNums
)
+
"
\n
"
,
type
=
1
)
writeToFile
(
"data/log1.txt"
,
"["
+
datetime
+
"]"
+
"剩余线程数:"
+
str
(
threadNums
)
+
"
\n
"
,
type
=
1
)
...
...
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