-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($Starter): abstract startup analysis
[skip ci]
- Loading branch information
1 parent
c4e9899
commit 0802aa2
Showing
10 changed files
with
134 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...in/java/com/jmsoftware/maf/reactivespringcloudstarter/helper/SpringBootStartupHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.jmsoftware.maf.reactivespringcloudstarter.helper; | ||
|
||
import com.jmsoftware.maf.reactivespringcloudstarter.configuration.MafProjectProperty; | ||
import lombok.NonNull; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.util.StopWatch; | ||
|
||
import java.time.Instant; | ||
import java.time.ZoneId; | ||
import java.util.TimeZone; | ||
|
||
/** | ||
* Description: SpringBootStartupHelper, change description here. | ||
* | ||
* @author 钟俊(zhongjun), email: zhongjun@toguide.cn, date: 2/10/2021 10:07 AM | ||
**/ | ||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
public class SpringBootStartupHelper { | ||
private static final String LINE_SEPARATOR = System.lineSeparator(); | ||
private final MafProjectProperty mafProjectProperty; | ||
private final IpHelper ipHelper; | ||
|
||
public void stop(@NonNull StopWatch stopWatch) { | ||
stopWatch.stop(); | ||
log.info("🥳 Congratulations! 🎉"); | ||
log.info("🖥 {}@{} started!", mafProjectProperty.getProjectArtifactId(), mafProjectProperty.getVersion()); | ||
log.info("⚙️ Environment: {}", mafProjectProperty.getEnvironment()); | ||
log.info("⏳ Deployment duration: {} seconds ({} ms)", stopWatch.getTotalTimeSeconds(), | ||
stopWatch.getTotalTimeMillis()); | ||
log.info("⏰ App started at {} (timezone - {})", Instant.now().atZone(ZoneId.of("UTC+8")), TimeZone.getDefault().getDisplayName()); | ||
log.info("{} App running at{} - Local: http://localhost:{}{}/{} - Network: http://{}:{}{}/", | ||
LINE_SEPARATOR, LINE_SEPARATOR, ipHelper.getServerPort(), mafProjectProperty.getContextPath(), | ||
LINE_SEPARATOR, ipHelper.getPublicIp(), ipHelper.getServerPort(), mafProjectProperty.getContextPath()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...r/src/main/java/com/jmsoftware/maf/springcloudstarter/helper/SpringBootStartupHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.jmsoftware.maf.springcloudstarter.helper; | ||
|
||
import com.jmsoftware.maf.springcloudstarter.configuration.MafProjectProperty; | ||
import lombok.NonNull; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.util.StopWatch; | ||
|
||
import java.time.Instant; | ||
import java.time.ZoneId; | ||
import java.util.TimeZone; | ||
|
||
/** | ||
* Description: SpringBootStartupHelper, change description here. | ||
* | ||
* @author 钟俊(zhongjun), email: zhongjun@toguide.cn, date: 2/10/2021 10:07 AM | ||
**/ | ||
@Slf4j | ||
@Component | ||
@RequiredArgsConstructor | ||
public class SpringBootStartupHelper { | ||
private static final String LINE_SEPARATOR = System.lineSeparator(); | ||
private final MafProjectProperty mafProjectProperty; | ||
private final IpHelper ipHelper; | ||
|
||
public void stop(@NonNull StopWatch stopWatch) { | ||
stopWatch.stop(); | ||
log.info("🥳 Congratulations! 🎉"); | ||
log.info("🖥 {}@{} started!", mafProjectProperty.getProjectArtifactId(), mafProjectProperty.getVersion()); | ||
log.info("⚙️ Environment: {}", mafProjectProperty.getEnvironment()); | ||
log.info("⏳ Deployment duration: {} seconds ({} ms)", stopWatch.getTotalTimeSeconds(), | ||
stopWatch.getTotalTimeMillis()); | ||
log.info("⏰ App started at {} (timezone - {})", Instant.now().atZone(ZoneId.of("UTC+8")), TimeZone.getDefault().getDisplayName()); | ||
log.info("{} App running at{} - Local: http://localhost:{}{}/{} - Network: http://{}:{}{}/", | ||
LINE_SEPARATOR, LINE_SEPARATOR, ipHelper.getServerPort(), mafProjectProperty.getContextPath(), | ||
LINE_SEPARATOR, ipHelper.getPublicIp(), ipHelper.getServerPort(), mafProjectProperty.getContextPath()); | ||
} | ||
} |