Page 1 of 1

SVN Rev:3501

PostPosted: Sat Jun 06, 2015 5:06 pm
by HunabKu
Commit from HunabKu

Log Messages:
- MODIFIED : Corrected GameServer/gameutils/StatPrint.cs but show error if data is null

Files Changed:
MODIFY - DOLSharp/trunk/GameServer/gameutils/StatPrint.cs

Re: SVN Rev:3501

PostPosted: Sun Jun 07, 2015 12:59 pm
by Leodagan
Could you explain why you check that PerformanceCounter are "not null" before "creating" them ?

Looks like you should check if they ARE null before initializing them...

These are private member they aren't initialized anywhere else, and the only way to initialize them twice would be to call "OnScriptCompiled" multiple time !

Which error did you want to fix ?

En Français :

Tu pourrais expliquer pourquoi tu vérifies que les PerformanceCounter ne soit "pas null" avant de les "créer" ?

Le plus logique serait de vérifier s'ils sont null avant de les initialiser...

Ce sont des membres privés de la classe qui ne sont initialisé nul part ailleurs, et la seule façon de les initialiser plusieurs fois serait d’appeler la méthode "OnScriptCompiled" à la main dans une autre partie du code !

Quel problème as tu voulu corriger ?

Re: SVN Rev:3501

PostPosted: Mon Jun 08, 2015 4:36 am
by HunabKu
In fact this "occupied" the server when one of these values is null, which made an error I are not on hand and slowed the server.

En fait ça "occupait" le serveur quand une de ces valeurs était null, ce qui rendait un message d'erreur que je n'es pas sous la main et ralentissait le serveur.

Re: SVN Rev:3501

PostPosted: Sun Jun 14, 2015 10:39 am
by Leodagan
As expected from your update :

We lost all 4 System Performance Counters...

Did you test this ?

No one ever reported CPU usage trouble from StatPrint Script !

I have to update or revert this commit...

Re: SVN Rev:3501

PostPosted: Sun Jun 14, 2015 10:43 am
by HunabKu
In my test serveur each counter are shown except if is null

Re: SVN Rev:3501

PostPosted: Sun Jun 14, 2015 10:52 am
by Leodagan
And these values are displayed on your server ? (After RegionTime Stats)
CPU=0,6% DOL=0,0% pg/s=0,0 dsk/s=1,6
Not possible with your code except if you initialize Perf Counter elsewhere...

Re: SVN Rev:3501

PostPosted: Wed Jun 17, 2015 6:30 am
by HunabKu
It's appear the null error message appear only when CPU=0,0%.

Re: SVN Rev:3501

PostPosted: Thu Jul 16, 2015 9:48 am
by HunabKu
I have the message again :
Code: Select all
DOL.WeakMulticastDelegate - InvokeSafe took 1217ms! method: DOL.GS.GameEvents.StatPrint.OnScriptCompiled target: null
With the last svn unmodifie code
Code: Select all
public static void OnScriptCompiled(DOLEvent e, object sender, EventArgs args) { lock (typeof(StatPrint)) { m_timerStatsByMgr = new Hashtable(); m_timer = new Timer(new TimerCallback(PrintStats), null, 10000, 0); // Create performance counters if (m_systemCpuUsedCounter == null) m_systemCpuUsedCounter = CreatePerformanceCounter("Processor", "% processor time", "_total"); if (m_processCpuUsedCounter == null) m_processCpuUsedCounter = CreatePerformanceCounter("Process", "% processor time", GetProcessCounterName()); if (m_memoryPages == null) m_memoryPages = CreatePerformanceCounter("Memory", "Pages/sec", null); if (m_physycalDisk == null) m_physycalDisk = CreatePerformanceCounter("PhysicalDisk", "Disk Transfers/sec", "_Total"); } }

Re: SVN Rev:3501

PostPosted: Thu Jul 16, 2015 1:54 pm
by Tolakram
It took 1.2 seconds to compile a script. Not sure that's an issue, or are you seeing something else?

Re: SVN Rev:3501

PostPosted: Thu Jul 16, 2015 3:13 pm
by HunabKu
What worries me is that it returns null and memory overflow risk but can be me I worry too much?

Re: SVN Rev:3501

PostPosted: Thu Jul 23, 2015 8:32 am
by Leodagan
Target is null because this Delegate is not related to any GameObject I think...

Like Tolakram says it's just a compile-time slow down warning !

If you notice any "run-time" error or warning then maybe it can be worth investigating.

Re: SVN Rev:3501

PostPosted: Fri Jul 24, 2015 7:13 am
by HunabKu
I've not anny other error. We'll leave it like that, it seemed safe.