Project

General

Profile

Development #81734

stats, optimiser le calcul du délai de traitement

Added by Valentin Deniaud 8 months ago. Updated 6 months ago.

Status:
Fermé
Priority:
Normal
Target version:
-
Start date:
28 September 2023
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No
Tags:

Description

Ça timeout sur les gros formulaires.

Associated revisions

Revision 9284e946 (diff)
Added by Valentin Deniaud 6 months ago

statistics: remove fallback on receipt time in resolution times (#81734)

Revision d9290667 (diff)
Added by Valentin Deniaud 6 months ago

tests: add more resolution times statistics tests (#81734)

Revision 78d64f0b (diff)
Added by Valentin Deniaud 6 months ago

statistics: aggregate resolution times with sql (#81734)

History

#2

Updated by Valentin Deniaud 7 months ago

  • Assignee set to Valentin Deniaud
#4

Updated by Valentin Deniaud 7 months ago

  • Assignee changed from Valentin Deniaud to Pierre Ducroquet

C'est ResolutionTimeView.get_statistics qu'il faut regarder, merci Pierre

#5

Updated by Pierre Ducroquet 7 months ago

La requête SQL "brute" correspondant à ce besoin:

with
        end_statuses as (select (values('wf-finished')) status),
        start_status as (select (values('wf-new')) status),
        foo as (
SELECT
        f.id,
        f.status,
        f.receipt_time,
        array_agg(start_evo.time) as starts,
        (array_agg(end_evo.time))[1] as end_time
FROM formdata_101_allo_toulouse_signalements f
JOIN formdata_101_allo_toulouse_signalements_evolutions start_evo ON start_evo.formdata_id = f.id AND start_evo.status in (select * from start_status) 
JOIN formdata_101_allo_toulouse_signalements_evolutions end_evo on end_evo.formdata_id = f.id AND end_evo.status in (select * from end_statuses) 
GROUP BY 1  ),
        bar as (
                SELECT id, COALESCE((select * from unnest(starts) x where x <= foo.end_time order by x desc limit 1), receipt_time) as start_time, end_time FROM foo
),
zoo as (SELECT end_time - start_time as d FROM bar WHERE end_time IS NOT NULL AND start_time IS NOT NULL)
select min(d), max(d), avg(d), percentile_cont(0.5) WITHIN GROUP (ORDER BY d) from zoo;

Je vois pour intégrer ça directement dans wcs.

#6

Updated by Robot Gitea 7 months ago

  • Status changed from Nouveau to En cours

Pierre Ducroquet (pducroquet) a ouvert une pull request sur Gitea concernant cette demande :

#7

Updated by Pierre Ducroquet 7 months ago

Note : la version optimisée ainsi s'exécute en moins de 3 secondes, contre un temps supérieur à 60s (non déterminé) pour la version python.

#8

Updated by Valentin Deniaud 6 months ago

  • Assignee changed from Pierre Ducroquet to Valentin Deniaud
#9

Updated by Robot Gitea 6 months ago

Valentin Deniaud (vdeniaud) a ouvert une pull request sur Gitea concernant cette demande :

#10

Updated by Robot Gitea 6 months ago

  • Status changed from En cours to Solution proposée
#11

Updated by Robot Gitea 6 months ago

  • Status changed from Solution proposée to Solution validée

Frédéric Péters (fpeters) a approuvé une pull request sur Gitea concernant cette demande :

#12

Updated by Robot Gitea 6 months ago

  • Status changed from Solution validée to Résolu (à déployer)

Valentin Deniaud (vdeniaud) a mergé une pull request sur Gitea concernant cette demande :

#13

Updated by Transition automatique 6 months ago

  • Status changed from Résolu (à déployer) to Solution déployée
#14

Updated by Robot Gitea 6 months ago

Valentin Deniaud (vdeniaud) a fermé une pull request sur Gitea concernant cette demande.

#15

Updated by Transition automatique 4 months ago

Automatic expiration

Also available in: Atom PDF