Administrator
|
Well.. I understand what you concern. We should optimize the mostly executing code as much as possible. However, executing once a second is not a big deal. Java is much faster than you think. If we can make clean code which is executed not much. I'd rather to choose clean code. Following is commented as I'm the author of it.. But It maybe come from prev-ngrinder 2.X version not from me.. public abstract class DateUtil { private static final SimpleDateFormat FULL_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()); /** * Convert string date to Date with {@value #SIMPLE_DATE_FORMAT}. * * @param strDate * date string * @return date * @throws ParseException * occurs when given steDate is not {@link #SIMPLE_DATE_FORMAT} */ public static Date toSimpleDate(String strDate) throws ParseException { return SIMPLE_DATE_FORMAT.parse(strDate); } } We may have thought FULL_DATE_FORMAT can be reused for every method invoke and enhance performance. However, it's not.. It causes the defect. Because SimpleDateFormat is not thread safe.. and causes a exception when this code is accessed by multiple thread. Like this.. sometimes optimization can cause the defect. What we should focus on in terms of performance is... SingleConsole#updateStatistics method I think.. It does a lot of job (including File IO) and frequently is invoked. Regards. JunHo Yoon Global Platform Development Lab / Senior Engineer 13th FL., Bundang First Tower, 266-1, Seohyeon-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, 463-824, KOREA Tel 031-600-9071 Fax -- Mobile 010-6255-0559 Email [hidden email] -----Original Message----- Thanks Juno for your update, to help us to get updated.
And about the code, I have some idea. I hope we can discuss about it.
For example: In PerfTestService class,
Before, I added the maximumConcurrentTestCount, to avoid getting this property value every time from the properties map. It needs to look over the map, get the value in String, and convert it into int. And this function will be called every several seconds in background.
And another example, PerfTestRunnable,
private boolean isScheduledNow(PerfTest test) { Date current = new Date(); Date scheduledDate = DateUtils .truncate((Date) defaultIfNull(test.getScheduledTime(), current), Calendar.MINUTE); return current.after(scheduledDate); }
This code will be called every 5 seconds too. In the isScheduledNow function, we created a new Date, in DateUtils.truncate() function also created a Calendar object, and the truncate() and after() function are more complicated than before.
What I think is, although these utility function is really easy to use and make the code clear. But at the same time, they also used many resources for the standard utility. Maybe it will not affect the system performance a lot, but it definitely will. If there are many these kind of code, maybe it will affect a lot.
So, I think we should consider a little more before we use them.
How do you guys thing?
发件人: Yoon, JunHo [mailto:[hidden email]]
Dear nGrinder developer...
In NHN korea, there are some task for the network isolation. They will block all ports under 10000 and only allows some 80, 8080 port to communicate b/w dev network and real service network. Currently we use following port.
- Agent Controller Server : 7001 - Console Port : 12000 - Monitoring Port : 3243
AgentControllerServer and Monitoring port will be blocked by that limitation.
So I changed port like following. - Agent Controller Server : 16001 - Console Port : 12000 - Monitoring Port : 13243
To get effective, we should update monitor and controller and agents.. Please be aware it.
Regards.
이 메일은 나눔글꼴로 작성되었습니다. 설치하기 JunHo Yoon 13th FL., Bundang First Tower, 266-1, Seohyeon-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, 463-824, KOREA
|
well, I still think we should consider performance anytime. Although Java will help us do some optimization, and JVM is really fast. We should also try to write clean and fast code.
About the formatter, I didn't notice it before, I just realized this problem. I think, we can remove all formatting in server side for double numbers. Because we have already done most of the formatting in freemarker. |
Administrator
|
:-) Just start from the important part. As I told you, I think updataStatistics are the most resource taking placel. JunHo Yoon Global Platform Development Lab / Senior Engineer 13th FL., Bundang First Tower, 266-1, Seohyeon-dong, Bundang-gu, Seongnam-si, Gyeonggi-do, 463-824, KOREA Tel 031-600-9071 Fax -- Mobile 010-6255-0559 Email [hidden email] -----Original Message----- If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/RE-nGrinder-port-changes-tp3p11.html
To start a new topic under ngrinder_dev, email [hidden email]
To unsubscribe from ngrinder_dev, click here. NAML |
Free forum by Nabble | Edit this page |