Project

General

Profile

Développement #81734

stats, optimiser le calcul du délai de traitement

Added by Valentin Deniaud over 1 year ago. Updated about 1 year 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 about 1 year ago

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

Revision d9290667 (diff)
Added by Valentin Deniaud about 1 year ago

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

Revision 78d64f0b (diff)
Added by Valentin Deniaud about 1 year ago

statistics: aggregate resolution times with sql (#81734)

History

#2

Updated by Valentin Deniaud over 1 year ago

  • Assignee set to Valentin Deniaud
#4

Updated by Valentin Deniaud over 1 year 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 over 1 year 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 over 1 year 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 over 1 year 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 about 1 year ago

  • Assignee changed from Pierre Ducroquet to Valentin Deniaud
#9

Updated by Robot Gitea about 1 year ago

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

#10

Updated by Robot Gitea about 1 year ago

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

Updated by Robot Gitea about 1 year 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 about 1 year 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 about 1 year ago

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

Updated by Robot Gitea about 1 year ago

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

#15

Updated by Transition automatique about 1 year ago

Automatic expiration

Also available in: Atom PDF