Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
csbase-dev
sgarest-daemon
Commits
6bd93d3e
Commit
6bd93d3e
authored
8 years ago
by
Felipe Pina
Browse files
Options
Download
Patches
Plain Diff
Suporte para envio de log parcial de fluxo
parent
f7327bca
master
centos-6.7
maia/4208/FixInvalidPropTestInCiCd
maia/9022/SgaCygwinInstall
maia/9564/DisableKubernetesDeploy
newfeature/SOMA-3699_IdentificarVersaoSGA
newfeature/SOMA-4444_AddSgaToK8s
sgarest-websintesi-backlog-historia-soma-1306
1.7.9
1.7.8
1.7.7
1.7.6
1.7.5
1.7.4
1.7.3
1.7.2
1.7.1
1.7.0
1.6.1
1.6.0
1.5.1
1.5.0
1.4.1-WS-centos6.7
1.4.1-WS
1.4.0
1.4.0-WS
1.3.1-WS
v_1.3.1-WS
v_1.3.0
v_1.3.0-WS
v_1.2.2
v_1.2.1
v_1.2.0
v_1.1.1
v_1.1.0
v_1.0.2
v_1.0.1
v_1.0.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sga/driver/posix.lua
+3
-1
sga/driver/posix.lua
sga/logchunk.lua
+54
-11
sga/logchunk.lua
with
57 additions
and
12 deletions
+57
-12
sga/driver/posix.lua
+
3
−
1
View file @
6bd93d3e
...
...
@@ -238,7 +238,9 @@ posix.actions = {
for
k
,
v
in
collect_exec_data
(
self
,
job
)
do
processes
[
1
][
k
]
=
v
end
processes
[
1
].
log_chunk
,
processes
[
1
].
log_chunk_seq
=
logchunk
.
read
(
job
)
for
k
,
v
in
pairs
(
logchunk
.
read
(
job
))
do
processes
[
1
][
k
]
=
v
end
-- If command has finished, returns information for parent process
else
processes
[
1
]
=
{
...
...
This diff is collapsed.
Click to expand it.
sga/logchunk.lua
+
54
−
11
View file @
6bd93d3e
...
...
@@ -4,24 +4,67 @@ local logchunk = {}
local
util
=
require
(
"sga.util"
)
local
stat
=
require
(
"posix.sys.stat"
)
function
logchunk
.
read
(
job
)
local
file
=
job
.
parameters
.
csbase_command_output_path
..
"/out.log"
if
not
stat
.
stat
(
file
)
then
local
function
read_file
(
job
,
file
)
local
offset
=
(
job
.
data
[
file
]
and
job
.
data
[
file
].
chunk_offset
)
or
0
local
seq
=
(
job
.
data
[
file
]
and
job
.
data
[
file
].
chunk_seq
)
or
0
local
chunk
=
util
.
read_file
(
file
,
offset
)
if
not
chunk
then
return
nil
end
local
offset
=
job
.
data
.
chunk_offset
or
0
local
seq
=
job
.
data
.
chunk_seq
or
0
if
not
job
.
data
[
file
]
then
job
.
data
[
file
]
=
{}
end
local
data
=
job
.
data
[
file
]
data
.
chunk_offset
=
offset
+
chunk
:
len
()
data
.
chunk_seq
=
seq
+
1
local
chunk
=
util
.
read_file
(
file
,
offset
)
if
not
chunk
then
return
nil
,
nil
return
chunk
,
data
.
chunk_seq
end
local
function
single
(
job
)
local
filename
=
"out.log"
local
filepath
=
job
.
parameters
.
csbase_command_output_path
..
"/"
..
filename
if
not
stat
.
stat
(
filepath
)
then
return
{}
else
local
chunk
,
chunk_seq
=
read_file
(
job
,
filepath
)
if
chunk
then
return
{
log_chunk
=
chunk
,
log_chunk_seq
=
chunk_seq
}
else
return
{}
end
end
end
job
.
data
.
chunk_offset
=
offset
+
chunk
:
len
()
job
.
data
.
chunk_seq
=
seq
+
1
local
function
multiple
(
job
)
local
ret
=
{}
local
fileformat
=
"out%d.log"
for
i
=
0
,
100
do
local
filename
=
string.format
(
fileformat
,
i
)
local
filepath
=
job
.
parameters
.
csbase_command_output_path
..
"/"
..
filename
print
(
i
)
if
not
stat
.
stat
(
filepath
)
then
break
else
local
chunk
,
chunk_seq
=
read_file
(
job
,
filepath
)
if
chunk
then
ret
[
"log_chunk."
..
i
]
=
chunk
ret
[
"log_chunk_seq."
..
i
]
=
chunk_seq
end
end
end
return
ret
end
return
chunk
,
job
.
data
.
chunk_seq
function
logchunk
.
read
(
job
)
local
singlelog
=
single
(
job
)
local
multiplelog
=
multiple
(
job
)
for
k
,
v
in
pairs
(
singlelog
)
do
multiplelog
[
k
]
=
v
end
return
multiplelog
end
return
logchunk
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets