new: analysis on reset_failed_though_reconfig_done

This commit is contained in:
Wataru Otsubo 2024-12-10 22:45:07 +09:00
parent dbc26816ee
commit 8b7902311c

View file

@ -12,11 +12,12 @@ begin
using PSBoardDataBase using PSBoardDataBase
using SQLite using SQLite
using DataFrames using DataFrames
using CSV
using CairoMakie using CairoMakie
using FHist using FHist
using LinearAlgebra using LinearAlgebra
using Printf using Printf
using PlutoUI using PlutoUI
end end
# ╔═╡ 3fccbdca-9856-4122-8597-9f267f90d390 # ╔═╡ 3fccbdca-9856-4122-8597-9f267f90d390
@ -67,9 +68,9 @@ map(eachrow(qaqc_extra_run_campaign_6)) do row
logfilename = "$(row.psboard_id)_$(row.runid)_longrun.txt" logfilename = "$(row.psboard_id)_$(row.runid)_longrun.txt"
logfile = joinpath("../test/input/slavelogs/main/", logfilename) logfile = joinpath("../test/input/slavelogs/main/", logfilename)
!ispath(logfile) && begin !ispath(logfile) && begin
@info "file $(logfile) not found" @info "file $(logfile) not found"
return missing return missing
end end
slave_result = PSBoardDataBase.SlaveLogParser.parse_slavelog_file(logfile) slave_result = PSBoardDataBase.SlaveLogParser.parse_slavelog_file(logfile)
map(slave_result.asdtp) do asdtp_result map(slave_result.asdtp) do asdtp_result
asdtp_result.pllld_fail_counter asdtp_result.pllld_fail_counter
@ -77,7 +78,7 @@ map(eachrow(qaqc_extra_run_campaign_6)) do row
end end
# ╔═╡ 34ae2948-bb5a-4086-beb1-cfb77593d678 # ╔═╡ 34ae2948-bb5a-4086-beb1-cfb77593d678
df_pllld_counts = combine( df_pllld_counts_camp6 = combine(
groupby(qaqc_extra_run_campaign_6, :id), groupby(qaqc_extra_run_campaign_6, :id),
AsTable([:psboard_id, :runid]) => AsTable([:psboard_id, :runid]) =>
( (
@ -96,30 +97,34 @@ df_pllld_counts = combine(
psboard_id = sdf.psboard_id[1], psboard_id = sdf.psboard_id[1],
runid = sdf.runid[1], runid = sdf.runid[1],
pllld_count = asdtp_result.pllld_fail_counter + 1, pllld_count = asdtp_result.pllld_fail_counter + 1,
reset_failed_though_reconfig_done = let
asdtp_result.reconfig_done_2 == 0 &&
asdtp_result.pllld_fail_counter == 10
end,
) )
end end
end end
) => [:psboard_id, :runid, :pllld_count], ) => [:psboard_id, :runid, :pllld_count, :reset_failed_though_reconfig_done],
) )
# ╔═╡ c084b8f4-dbc2-497b-9132-7e4bd4fd3874 # ╔═╡ c084b8f4-dbc2-497b-9132-7e4bd4fd3874
sort(df_pllld_counts, :pllld_count, rev = true) sort(df_pllld_counts_camp6, :pllld_count, rev = true)
# ╔═╡ 6d85cc29-0d02-43b4-8a50-57f003e4686b # ╔═╡ 6d85cc29-0d02-43b4-8a50-57f003e4686b
let let
df = combine(groupby(df_pllld_counts, :id), nrow) df = combine(groupby(df_pllld_counts_camp6, :id), nrow)
sort!(df, :nrow) sort!(df, :nrow)
end end
# ╔═╡ e95447c1-a8e2-4a46-9320-e1a88d9e34da # ╔═╡ e95447c1-a8e2-4a46-9320-e1a88d9e34da
unique(df_pllld_counts.psboard_id) |> sort unique(df_pllld_counts_camp6.psboard_id) |> sort
# ╔═╡ 0433bbe4-1f71-4cf7-96ec-ac9c70170feb # ╔═╡ 0433bbe4-1f71-4cf7-96ec-ac9c70170feb
stephist(df_pllld_counts.pllld_count) stephist(df_pllld_counts_camp6.pllld_count)
# ╔═╡ f04d5c95-7308-4129-ba95-49da2e142d5d # ╔═╡ f04d5c95-7308-4129-ba95-49da2e142d5d
let let
h1 = Hist1D(df_pllld_counts.pllld_count; binedges = 1:1:10, overflow = false) h1 = Hist1D(df_pllld_counts_camp6.pllld_count; binedges = 1:1:10, overflow = false)
h1 = normalize(h1) h1 = normalize(h1)
fig = Figure() fig = Figure()
ax = Axis( ax = Axis(
@ -142,18 +147,97 @@ let
fig[1, 1], fig[1, 1],
""" """
n = $(nentries(h1)) n = $(nentries(h1))
$(length(unique(df_pllld_counts.psboard_id))) PS-Boards $(length(unique(df_pllld_counts_camp6.psboard_id))) PS-Boards
""", """,
tellwidth = false, tellwidth = false,
tellheight = false, tellheight = false,
halign = :right, halign = :right,
padding = (20, 20, 20, 20), padding = (20, 20, 20, 20),
) )
save("pllld_fail_counts.svg", fig) save("pllld_fail_counts.svg", fig)
fig fig
end end
# ╔═╡ 650482e5-9b79-4304-aa5a-2b7c9a377013
md"""
## "reconfig_done = 0なのにresetしていない" の数
"""
# ╔═╡ 4b9c0bd8-b17a-4933-8d6e-2da884fc4b5e
combine(
groupby(df_pllld_counts_camp6, :id),
AsTable(:) =>
(
sdf -> begin
@assert allequal(sdf.psboard_id)
@assert allequal(sdf.runid)
(
reset_failed_though_reconfig_done = count(
sdf.reset_failed_though_reconfig_done,
),
psboard_id = first(sdf.psboard_id),
runid = first(sdf.runid),
)
end
) => [:reset_failed_though_reconfig_done, :psboard_id, :runid],
)
# ╔═╡ a0baf37c-8b05-49c1-a6a4-027f3404f8b4
df_reset_failed_though_reconfig_done = combine(
groupby(qaqc_extra_run_results, :id),
AsTable([:psboard_id, :runid]) =>
(
sdf -> begin
@assert nrow(sdf) == 1
logfilename = "$(sdf.psboard_id[1])_$(sdf.runid[1])_longrun.txt"
logfile = joinpath("../test/input/slavelogs/main/", logfilename)
!ispath(logfile) && begin
@warn "logfile $(logfile) not found"
return (
psboard_id = sdf.psboard_id[1],
runid = sdf.runid[1],
reset_failed_though_reconfig_done = missing,
)
end
if sdf.runid[1] == 99
@info "skipping runid 99 since it is not exactly 100 run"
return (
psboard_id = sdf.psboard_id[1],
runid = sdf.runid[1],
reset_failed_though_reconfig_done = missing,
)
end
slave_result =
PSBoardDataBase.SlaveLogParser.parse_slavelog_file(logfile)
return (
psboard_id = sdf.psboard_id[1],
runid = sdf.runid[1],
reset_failed_though_reconfig_done = count(
slave_result.asdtp,
) do asdtp_result
asdtp_result.reconfig_done_2 == 0 &&
asdtp_result.pllld_fail_counter == 10
end,
)
end
) => [:psboard_id, :runid, :reset_failed_though_reconfig_done],
)
# ╔═╡ 14519d45-a6a9-4ba1-a4f2-9597d1335b2c
let
df_compare = outerjoin(
df_reset_failed_though_reconfig_done,
select(qaqc_extra_run_results, [:id, :reset_failed_though_reconfig_done]),
on = :id,
renamecols = "_old" => "_new",
)
end
# ╔═╡ dfeb3900-539f-4d8d-8103-edb67cf4e890
#CSV.write("reset_failed_though_reconfig_done.csv", df_reset_failed_though_reconfig_done)
# ╔═╡ Cell order: # ╔═╡ Cell order:
# ╠═3fccbdca-9856-4122-8597-9f267f90d390 # ╠═3fccbdca-9856-4122-8597-9f267f90d390
# ╠═635dcf78-b6b3-11ef-3a04-f5b7c43ed12d # ╠═635dcf78-b6b3-11ef-3a04-f5b7c43ed12d
@ -173,3 +257,8 @@ end
# ╠═e95447c1-a8e2-4a46-9320-e1a88d9e34da # ╠═e95447c1-a8e2-4a46-9320-e1a88d9e34da
# ╠═0433bbe4-1f71-4cf7-96ec-ac9c70170feb # ╠═0433bbe4-1f71-4cf7-96ec-ac9c70170feb
# ╠═f04d5c95-7308-4129-ba95-49da2e142d5d # ╠═f04d5c95-7308-4129-ba95-49da2e142d5d
# ╟─650482e5-9b79-4304-aa5a-2b7c9a377013
# ╠═4b9c0bd8-b17a-4933-8d6e-2da884fc4b5e
# ╠═a0baf37c-8b05-49c1-a6a4-027f3404f8b4
# ╠═14519d45-a6a9-4ba1-a4f2-9597d1335b2c
# ╠═dfeb3900-539f-4d8d-8103-edb67cf4e890