
    i                         d Z ddlZddlmZ d Zedk(  r		  e        yy# e$ r  ed       Y ye$ rZ	 ede	        Y dZ	[	ydZ	[	ww xY w)u-   
Vérification des performances du dashboard
    N)Counterc                  8   t        d       t        d       t        d       t        ddd      5 } | j                         }d d d        t        d       t        d       t        j                  d	      }t        |      }d
}t        |j                         d       D ]<  \  }}t        |      dz  }d|z  |z  }||z  }t        d|dd|dd|dd|dd	       > t        d|dd       |dk  rt        d       n|dk  rt        d       nt        d       t        d       t        d       t        t        j                  d |            }	t        t        j                  d!|            }
t        d"|	        t        d#|
        |	d$k  rt        d%       nt        d&|	 d'       t        d(       t        d       t        j                  d)|      }|r.|j                  d*      }|d+k(  rt        d,       nt        d-       nt        d.       t        d/       t        d       |j                  d0      }|j                  d1      }t        d2|        t        d3|        d4|v rd1|v rt        d5       nt        d6       t        d7       t        d8       t        d       d
}d9}|d:k  r|d;z  }d<}n!|d=k  r|d>z  }d?}n|dk  r|d@z  }dA}n|dBz  }dC}|	d$k  r|d@z  }n
|	dBk  r|dBz  }|r|j                  d*      d+k(  r|d@z  }d4|v r|d@z  }t        dD| dE| dF       t        dG| dH|ddI       |dJk\  rt        dK       t        dL       n2|dMk\  rt        dN       t        dO       nt        dP       t        dQ       t        d7       y # 1 sw Y   PxY w)RNzF======================================================================u"   🔍 ANALYSE PERFORMANCE DASHBOARDzdashboard.htmlrzutf-8)encodingu"   
📊 INTERVALLES DE MISE À JOUR:zF----------------------------------------------------------------------zsetInterval\([^,]+,\s*(\d+)\)r   c                     t        | d         S )Nr   )int)xs     ./check_dashboard_performance.py<lambda>z/analyze_dashboard_performance.<locals>.<lambda>   s    3qQRt9     )keyi  i  z   z>6zms (z>4.0fu   s) × z>2z
 timers = z>6.0fz	 appels/hu   
   📈 TOTAL: ~z.0fu    requêtes/heureu,      ✅ Performance EXCELLENTE (< 1000 req/h)i  u0      ⚠️ Performance CORRECTE (1000-2000 req/h)u(      ❌ Performance FAIBLE (> 2000 req/h)u   
🎨 ANIMATIONS CSS:zanimation:\s*[^;]+;(?!\s*/\*)z/\*\s*animation:z   Animations actives:     u      Animations désactivées:    u      ✅ Animations optimiséesu      ⚠️ Trop d'animations ()u   
🐛 MODE DEBUG:z%const\s+DEBUG_MODE\s*=\s*(true|false)   falseu1      ✅ Mode production (console.log désactivés)u1      ⚠️ Mode debug actif (console.log visibles)u      ❌ DEBUG_MODE non trouvéu   
🔄 OPTIMISATIONS BOUCLES:zSYMBOLS.forEachzObject.keys(openPositions)z   Boucles SYMBOLS.forEach:  z   Checks positions:         symbolsToUpdateu(      ✅ Optimisation positions détectéeu!      ⚠️ Boucles non optimiséeszG
======================================================================u    📊 SCORE GLOBAL DE PERFORMANCEd   iX  (   	EXCELLENTi     BON   MOYEN
   FAIBLEz
   Score: /z pointsu   
   Niveau requêtes:  z (z req/h)P   u6   
   ✅ DASHBOARD OPTIMISÉ - Performance excellente !u#      💡 Fluidité maximale garantie<   u7   
   ⚠️ Dashboard correct - Améliorations possiblesu)      💡 Quelques optimisations manquantesu;   
   ❌ Dashboard non optimisé - Ralentissements possiblesu1      💡 Appliquer les optimisations recommandées)printopenreadrefindallr   sorteditemsr   lensearchgroupcount)fcontent	intervalsinterval_statstotal_calls_per_hourinterval_msr)   
interval_scalls_per_houractive_animationscommented_animationsdebug_mode_match
debug_modesymbols_foreachpositions_checkscore	max_scoreperf_reqs                     r
   analyze_dashboard_performancer;      s   	&M	
./	&M	g	6 !&&( 

/0	(O

;WEIY'N$^%9%9%;ATU uU%,
+u4.K#4
5'9bzTbchSiirstu 
3C88H
IJd"<=		$@A89 

"#	(OBJJ'GQRrzz*=wGH	'(9':
;<	)*>)?
@A1-.-.?-@BC 

	(Oyy!I7S%++A.
 EFEF-. 

)*	(Omm$56Omm$@AO	)/):
;<	)/):
;<G#(D(O8912 
-	
,-	&MEI c!		$		$ 1	R	 ,2215@ G#	Lq7
34	$XJb1Ec0J'
RS{GH34	"HI9:LMAB	-q s   NN__main__u&   ❌ Fichier dashboard.html non trouvéu   ❌ Erreur: )
__doc__r"   collectionsr   r;   __name__FileNotFoundErrorr   	Exceptione r   r
   <module>rD      sh    
 }~ z"%'   867 "QC !!"s    AAAA