Log System efficiency
#2

i suggest you to keep the file open while the server is running. if you restart/exit/crash the server, the file will remain intact.
to estimate the CPU usage, i suggest you to use the Profiler Plugin by Incognito
https://sampforum.blast.hk/showthread.php?tid=271129
if your players arent spamming >50 lines per second, then dont hesitate to log each line. just script it, and see how many microseconds each log needs...
Код:
Function  	Calls  	Time per call, µs  	Overall time, µs  	Overall time, %
fread  		39285  	4  			159927  		0.18
format  	502542  3  			1337524  		1.54
fclose  	320  	12  			3883  			0.00
a quick estimation of file read processes. takes 4 microseconds each. assuming that youre not processing the strings anymore before logging, i guess 1 chatline will take like 80-200 µs to process (fopen, format string, fwrite, fclose).
if you keep it open, then you save "only" 2 processes each. wont matter if you ask me hehe
Reply


Messages In This Thread
Log System efficiency - by Incubator - 05.08.2011, 21:22
Re: Log System efficiency - by Babul - 05.08.2011, 22:08
Re: Log System efficiency - by Incubator - 05.08.2011, 22:19
Re: Log System efficiency - by Babul - 05.08.2011, 22:35
Re: Log System efficiency - by Incubator - 05.08.2011, 22:56
Re: Log System efficiency - by Babul - 06.08.2011, 01:27

Forum Jump:


Users browsing this thread: 1 Guest(s)