Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
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
ops
coco
Commits
09167f5b
Commit
09167f5b
authored
Dec 23, 2017
by
i317280
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
828981fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
recorder.py
coco/recorder.py
+6
-2
No files found.
coco/recorder.py
View file @
09167f5b
...
...
@@ -8,6 +8,7 @@ import threading
import
time
import
os
import
gzip
import
json
import
shutil
from
.alignment
import
MemoryQueue
...
...
@@ -102,8 +103,11 @@ class ServerReplayRecorder(ReplayRecorder):
"""
# Todo: <liuzheng712@gmail.com>
if
len
(
data
[
'data'
])
>
0
:
# print(json.dumps(
# data['data'].decode('utf-8', 'replace')))
self
.
file
.
write
(
'"'
+
str
(
data
[
'timestamp'
]
-
self
.
starttime
)
+
'":"'
+
data
[
'data'
]
.
decode
(
'utf-8'
,
'replace'
)
+
'",'
)
'"'
+
str
(
data
[
'timestamp'
]
-
self
.
starttime
)
+
'":'
+
json
.
dumps
(
data
[
'data'
]
.
decode
(
'utf-8'
,
'replace'
))
+
','
)
def
session_start
(
self
,
session_id
):
self
.
starttime
=
time
.
time
()
...
...
@@ -113,7 +117,7 @@ class ServerReplayRecorder(ReplayRecorder):
self
.
file
.
write
(
'{'
)
def
session_end
(
self
,
session_id
):
self
.
file
.
write
(
'}'
)
self
.
file
.
write
(
'
"0":""
}'
)
self
.
file
.
close
()
with
open
(
os
.
path
.
join
(
self
.
app
.
config
[
'LOG_DIR'
],
session_id
+
'.replay'
),
'rb'
)
as
f_in
,
\
gzip
.
open
(
os
.
path
.
join
(
self
.
app
.
config
[
'LOG_DIR'
],
session_id
+
'.replay.gz'
),
'wb'
)
as
f_out
:
...
...
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