global: Log elapsed time of booting sequence
@758349c67c81262e24e7a0331287522de5a93bf9
--- app/Global.java
+++ app/Global.java
... | ... | @@ -158,17 +158,27 @@ |
158 | 158 |
isSecretInvalid = equalsDefaultSecret(); |
159 | 159 |
insertInitialData(); |
160 | 160 |
|
161 |
+ Timestamp timestamp = new Timestamp("=== Yona server starting initialization ==="); |
|
161 | 162 |
Config.onStart(); |
163 |
+ timestamp.logElapsedTime("--- Config reading: ok!"); |
|
162 | 164 |
Property.onStart(); |
165 |
+ timestamp.logElapsedTime("--- Property reading: ok!"); |
|
163 | 166 |
PullRequest.onStart(); |
167 |
+ timestamp.logElapsedTime("--- Pull request checking: ok!"); |
|
164 | 168 |
NotificationMail.onStart(); |
169 |
+ timestamp.logElapsedTime("--- Notification mail scheduler: ok!"); |
|
165 | 170 |
NotificationEvent.onStart(); |
171 |
+ timestamp.logElapsedTime("--- Notification event cleanup scheduler: ok!"); |
|
166 | 172 |
Attachment.onStart(); |
173 |
+ timestamp.logElapsedTime("--- Temporary files cleanup scheduler: ok!"); |
|
167 | 174 |
AccessControl.onStart(); |
175 |
+ timestamp.logElapsedTime("--- Basic access controller config reading: ok!"); |
|
168 | 176 |
|
169 | 177 |
if (!isSecretInvalid) { |
170 | 178 |
YobiUpdate.onStart(); |
179 |
+ timestamp.logElapsedTime("--- Update checker run: ok! "); |
|
171 | 180 |
mailboxService.start(); |
181 |
+ timestamp.logElapsedTime("--- MailboxService checker run: ok!"); |
|
172 | 182 |
} |
173 | 183 |
|
174 | 184 |
PlayAuthenticate.setResolver(new PlayAuthenticate.Resolver() { |
+++ app/utils/Timestamp.java
... | ... | @@ -0,0 +1,24 @@ |
1 | +/** | |
2 | + * Yona, 21st Century Project Hosting SW | |
3 | + * <p> | |
4 | + * Copyright Yona & Yobi Authors & NAVER Corp. & NAVER LABS Corp. | |
5 | + * https://yona.io | |
6 | + **/ | |
7 | + | |
8 | +package utils; | |
9 | + | |
10 | +public class Timestamp { | |
11 | + | |
12 | + private long lastCheckedTime; | |
13 | + | |
14 | + public Timestamp(String title) { | |
15 | + this.lastCheckedTime = System.currentTimeMillis(); | |
16 | + play.Logger.info(title); | |
17 | + } | |
18 | + | |
19 | + public void logElapsedTime(String message) { | |
20 | + long currentTimeMillis = System.currentTimeMillis(); | |
21 | + play.Logger.info(message + " - " + (currentTimeMillis - lastCheckedTime) + " ms"); | |
22 | + lastCheckedTime = currentTimeMillis; | |
23 | + } | |
24 | +} |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?