mirror of
https://gitlab.cern.ch/wotsubo/PSBoardDataBase.git
synced 2025-07-02 09:39:24 +09:00
update(SlaveLogParser): modify Recov parse and add to full parser
- including test cases for both section wise and Integrated
This commit is contained in:
parent
5ca921bcfc
commit
f1db431f7e
2 changed files with 26 additions and 6 deletions
|
@ -327,8 +327,11 @@ function parse_asdtp_section!(lines::Base.Iterators.Stateful)::AsdtpResult
|
|||
)
|
||||
end
|
||||
|
||||
# ==================================
|
||||
# Recov
|
||||
|
||||
"""
|
||||
parse_qspip_section(lines::Base.Iterators.Stateful)
|
||||
parse_recov_section!(lines::Base.Iterators.Stateful)
|
||||
|
||||
Parse Recov section of given stateful iterator of log.
|
||||
|
||||
|
@ -336,18 +339,18 @@ Parse Recov section of given stateful iterator of log.
|
|||
- `lines`: Stateful iterator of slave log file lines
|
||||
|
||||
# Return
|
||||
- `nothing`: if failed to parse
|
||||
- `missing`: if failed to parse
|
||||
- `true`: if successed
|
||||
- `false`
|
||||
"""
|
||||
function parse_recov_section!(lines::Base.Iterators.Stateful)
|
||||
function parse_recov_section!(lines::Base.Iterators.Stateful)::Union{Bool, Missing}
|
||||
line = popfirst!(lines)
|
||||
if startswith("====")(line)
|
||||
line = popfirst!(lines)
|
||||
end
|
||||
m = match(r"Test Recov Result = (\d+)", line)
|
||||
if isnothing(m)
|
||||
return nothing
|
||||
return missing
|
||||
else
|
||||
return m[1] == "1"
|
||||
end
|
||||
|
@ -363,6 +366,7 @@ function parse_slavelog_file(filename::AbstractString)
|
|||
|
||||
asdtp_results = AsdtpResult[]
|
||||
power_results = PowerResult[]
|
||||
recov_results = Union{Bool, Missing}[]
|
||||
|
||||
mode::SlaveLogSection = MODE_NONE
|
||||
# main loop
|
||||
|
@ -384,12 +388,13 @@ function parse_slavelog_file(filename::AbstractString)
|
|||
push!(asdtp_results, result)
|
||||
mode = MODE_NONE
|
||||
elseif mode == MODE_RECOV
|
||||
parse_recov_section!(lines_iter)
|
||||
result = parse_recov_section!(lines_iter)
|
||||
push!(recov_results, result)
|
||||
mode = MODE_NONE
|
||||
end
|
||||
end
|
||||
|
||||
return (asdtp = asdtp_results, power = power_results)
|
||||
return (asdtp = asdtp_results, power = power_results, recov = recov_results)
|
||||
end
|
||||
|
||||
function eff99_count_map(asdtp_results)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue