@@ -1567,9 +1567,8 @@ impl EventStore {
15671567 interval = interval,
15681568 secondary_interval = secondary_interval
15691569 ) ;
1570- let work_packages: Vec < serde_json:: Value > = sqlx:: query_scalar ( & query)
1571- . fetch_all ( & self . pool )
1572- . await ?;
1570+ let work_packages: Vec < serde_json:: Value > =
1571+ sqlx:: query_scalar ( & query) . fetch_all ( & self . pool ) . await ?;
15731572
15741573 // Compute summary + failure breakdown from the result set
15751574 let mut total = 0i64 ;
@@ -1617,28 +1616,60 @@ impl EventStore {
16171616
16181617 // Count "reached" by checking stage timestamps (non-null = reached)
16191618 if let Some ( stages) = wp. get ( "stages" ) {
1620- if !stages. get ( "received" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1619+ if !stages
1620+ . get ( "received" )
1621+ . unwrap_or ( & serde_json:: Value :: Null )
1622+ . is_null ( )
1623+ {
16211624 reached_received += 1 ;
16221625 }
1623- if !stages. get ( "authorized" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1626+ if !stages
1627+ . get ( "authorized" )
1628+ . unwrap_or ( & serde_json:: Value :: Null )
1629+ . is_null ( )
1630+ {
16241631 reached_authorized += 1 ;
16251632 }
1626- if !stages. get ( "refined" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1633+ if !stages
1634+ . get ( "refined" )
1635+ . unwrap_or ( & serde_json:: Value :: Null )
1636+ . is_null ( )
1637+ {
16271638 reached_refined += 1 ;
16281639 }
1629- if !stages. get ( "report_built" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1640+ if !stages
1641+ . get ( "report_built" )
1642+ . unwrap_or ( & serde_json:: Value :: Null )
1643+ . is_null ( )
1644+ {
16301645 reached_report_built += 1 ;
16311646 }
1632- if !stages. get ( "guarantee_built" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1647+ if !stages
1648+ . get ( "guarantee_built" )
1649+ . unwrap_or ( & serde_json:: Value :: Null )
1650+ . is_null ( )
1651+ {
16331652 reached_guarantee_built += 1 ;
16341653 }
1635- if !stages. get ( "distributed" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1654+ if !stages
1655+ . get ( "distributed" )
1656+ . unwrap_or ( & serde_json:: Value :: Null )
1657+ . is_null ( )
1658+ {
16361659 reached_distributed += 1 ;
16371660 }
1638- if !stages. get ( "guarantee_received" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1661+ if !stages
1662+ . get ( "guarantee_received" )
1663+ . unwrap_or ( & serde_json:: Value :: Null )
1664+ . is_null ( )
1665+ {
16391666 reached_guarantee_received += 1 ;
16401667 }
1641- if !stages. get ( "included" ) . unwrap_or ( & serde_json:: Value :: Null ) . is_null ( ) {
1668+ if !stages
1669+ . get ( "included" )
1670+ . unwrap_or ( & serde_json:: Value :: Null )
1671+ . is_null ( )
1672+ {
16421673 reached_included += 1 ;
16431674 }
16441675 }
@@ -1656,10 +1687,26 @@ impl EventStore {
16561687 ( "received" , "authorized" , "received_to_authorized" ) ,
16571688 ( "authorized" , "refined" , "authorized_to_refined" ) ,
16581689 ( "refined" , "report_built" , "refined_to_report_built" ) ,
1659- ( "report_built" , "guarantee_built" , "report_built_to_guarantee_built" ) ,
1660- ( "guarantee_built" , "distributed" , "guarantee_built_to_distributed" ) ,
1661- ( "distributed" , "guarantee_received" , "distributed_to_guarantee_received" ) ,
1662- ( "guarantee_received" , "included" , "guarantee_received_to_included" ) ,
1690+ (
1691+ "report_built" ,
1692+ "guarantee_built" ,
1693+ "report_built_to_guarantee_built" ,
1694+ ) ,
1695+ (
1696+ "guarantee_built" ,
1697+ "distributed" ,
1698+ "guarantee_built_to_distributed" ,
1699+ ) ,
1700+ (
1701+ "distributed" ,
1702+ "guarantee_received" ,
1703+ "distributed_to_guarantee_received" ,
1704+ ) ,
1705+ (
1706+ "guarantee_received" ,
1707+ "included" ,
1708+ "guarantee_received_to_included" ,
1709+ ) ,
16631710 ] ;
16641711
16651712 let mut stage_duration_percentiles = serde_json:: Map :: new ( ) ;
0 commit comments