Skip to content

Commit

Permalink
Merge pull request #46 from LeeKyoungIl/master
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
LeeKyoungIl authored Mar 20, 2018
2 parents 2db4c24 + d3437bc commit 8dd5ca0
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 120 deletions.
6 changes: 3 additions & 3 deletions ApiServerSample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,21 @@
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-jscollector</artifactId>
<version>0.5.3</version>
<version>0.5.5</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-processor</artifactId>
<version>0.9.9.2</version>
<version>0.9.9.4</version>
<scope>compile</scope>
</dependency>

<!--<dependency>-->
<!--<groupId>com.leekyoungil.illuminati</groupId>-->
<!--<artifactId>illuminati-client-switch</artifactId>-->
<!--<version>1.0.4</version>-->
<!--<version>1.0.5</version>-->
<!--<scope>compile</scope>-->
<!--</dependency>-->

Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ The illuminati is desinged to make collect all data easily and it can be possibl
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-processor</artifactId>
<version>0.9.9.2</version>
<version>0.9.9.4</version>
</dependency>

<!-- This is an option. If you add the module, you can turn it on and off without deploying it. -->
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-switch</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
</dependency>

<!-- This is an option. If you add the module, you can collect Event data from Browser to server to response by one transaction id. -->
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-jscollector</artifactId>
<version>0.5.3</version>
<version>0.5.5</version>
</dependency>
</dependencies>
```
Expand All @@ -113,11 +113,11 @@ repositories {
}

compile 'com.leekyoungil.illuminati:illuminati-client-annotation:1.1.1'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.2'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.4'
// This is an option. If you add the module, you can turn it on and off without deploying it.
compile 'com.leekyoungil.illuminati:illuminati-client-switch:1.0.4'
compile 'com.leekyoungil.illuminati:illuminati-client-switch:1.0.5'
<!-- This is an option. If you add the module, you can collect Event data from Browser to server to response by one transaction id. -->
compile 'com.leekyoungil.illuminati:illuminati-client-jscollectorswitch:0.5.3'
compile 'com.leekyoungil.illuminati:illuminati-client-jscollectorswitch:0.5.5'
```

## add @Illuminati to Class
Expand Down Expand Up @@ -275,21 +275,21 @@ Application에서 발생하는 모든데이터를 수집하고 그중에 어떤
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-processor</artifactId>
<version>0.9.9.2</version>
<version>0.9.9.4</version>
</dependency>

<!-- 이것은 옵션 입니다. 해당 모듈을 추가하면 대시 배포 없이 on, off할수 있습니다. -->
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-switch</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
</dependency>

<!-- 이것은 옵션 입니다. 해당 모듈을 추가하면 브라우저에서 발생된 Event data까지 수집할수 있습니다. -->
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-jscollector</artifactId>
<version>0.5.3</version>
<version>0.5.5</version>
</dependency>
</dependencies>
```
Expand All @@ -303,11 +303,11 @@ repositories {
}

compile 'com.leekyoungil.illuminati:illuminati-client-annotation:1.1.1'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.2'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.4'
//이것은 옵션 입니다. 해당 모듈을 추가하면 대시 배포 없이 on, off할수 있습니다.
compile 'com.leekyoungil.illuminati:illuminati-client-switch:1.0.4'
compile 'com.leekyoungil.illuminati:illuminati-client-switch:1.0.5'
//이것은 옵션 입니다. 해당 모듈을 추가하면 브라우저에서 발생된 Event data까지 수집할수 있습니다.
compile 'com.leekyoungil.illuminati:illuminati-client-jscollector:0.5.3'
compile 'com.leekyoungil.illuminati:illuminati-client-jscollector:0.5.5'
```

## Class에 @Illuminati 추가
Expand Down Expand Up @@ -378,5 +378,5 @@ public class ApiSampleController {
![image](https://github.com/LeeKyoungIl/illuminati/blob/master/kibana-sample.png)

# License
illuminati is distributed under the [Apache Software License](https://www.apache.org/licenses/LICENSE-2.0) version 2.0.
illuminati is distributed under the GNU GPL version 3 or later.

8 changes: 4 additions & 4 deletions illuminati-client/illuminati-client-annotation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-processor</artifactId>
<version>0.9.9.2</version>
<version>0.9.9.4</version>
</dependency>
```

Expand All @@ -29,7 +29,7 @@

```java
compile 'com.leekyoungil.illuminati:illuminati-client-annotation:1.1.1'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.2'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.4'
```

## add @Illuminati to Class
Expand Down Expand Up @@ -121,7 +121,7 @@ public class ApiSampleController {
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-processor</artifactId>
<version>0.9.9.2</version>
<version>0.9.9.4</version>
</dependency>
```

Expand All @@ -130,7 +130,7 @@ public class ApiSampleController {

```java
compile 'com.leekyoungil.illuminati:illuminati-client-annotation:1.1.1'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.2'
compile 'com.leekyoungil.illuminati:illuminati-client-processor:0.9.9.4'
```


Expand Down
2 changes: 1 addition & 1 deletion illuminati-client/illuminati-client-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-common</artifactId>
<version>1.2.2</version>
<version>1.2.3</version>
<packaging>jar</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class SystemUtil {

private static final Logger SYSTEM_UTIL_LOGGER = LoggerFactory.getLogger(SystemUtil.class);
public static final Logger SYSTEM_UTIL_LOGGER = LoggerFactory.getLogger(SystemUtil.class);

private final static Runtime RUNTIME = Runtime.getRuntime();

Expand All @@ -26,7 +26,7 @@ public class SystemUtil {
"PID"};


private static final int MB = 1024*1024;
private static final int MEGA_BYTE = 1024*1024;

public static Map<String, Object> getJvmInfo () {
final Map<String, Object> jvmInfo = new HashMap<String, Object>();
Expand All @@ -44,75 +44,78 @@ public static Map<String, Object> getJvmInfo () {

public static Map<String, Object> getJvmMemoryInfo () {
final Map<String, Object> jvmInfo = new HashMap<String, Object>();
jvmInfo.put("jvmUsedMemory", (RUNTIME.totalMemory() - RUNTIME.freeMemory()) / MB);
jvmInfo.put("jvmFreeMemory", RUNTIME.freeMemory() / MB);
jvmInfo.put("jvmTotalMemory", RUNTIME.totalMemory() / MB);
jvmInfo.put("jvmMaxMemory", RUNTIME.maxMemory() / MB);
jvmInfo.put("jvmUsedMemory", (RUNTIME.totalMemory() - RUNTIME.freeMemory()) / MEGA_BYTE);
jvmInfo.put("jvmFreeMemory", RUNTIME.freeMemory() / MEGA_BYTE);
jvmInfo.put("jvmTotalMemory", RUNTIME.totalMemory() / MEGA_BYTE);
jvmInfo.put("jvmMaxMemory", RUNTIME.maxMemory() / MEGA_BYTE);

return jvmInfo;
}

public static String generateTransactionIdByRequest (final HttpServletRequest request, final IlluminatiTransactionIdType illuminatiTransactionIdType) {
String keyName = illuminatiTransactionIdType.getValue();
final String keyName = illuminatiTransactionIdType.getValue();

String id = SystemUtil.getValueFromHeaderByKey(request, keyName);
if (StringObjectUtils.isValid(id) == false) {
String trxId = SystemUtil.getValueFromHeaderByKey(request, keyName);
if (StringObjectUtils.isValid(trxId) == false && request != null) {
switch (illuminatiTransactionIdType) {
case ILLUMINATI_PROC_ID :
case ILLUMINATI_G_PROC_ID :
id = StringObjectUtils.generateId(new Date().getTime(), keyName);
request.setAttribute(keyName, id);
trxId = StringObjectUtils.generateId(new Date().getTime(), keyName);
request.setAttribute(keyName, trxId);
break;

default :
break;
}
}

return StringObjectUtils.isValid(id) ? id : null;
return (StringObjectUtils.isValid(trxId) == true) ? trxId : null;
}

public static String getValueFromHeaderByKey (final HttpServletRequest request, final String keyName) {
if (request == null || keyName == null) {
return null;
}
Object value = null;

Object value = request.getHeader(keyName);
if (request != null && keyName != null) {
value = request.getHeader(keyName);

if (value == null) {
value = request.getAttribute(keyName);
if (value == null) {
value = request.getAttribute(keyName);
}
}

return (value != null) ? value.toString() : null;
}

public static void createSystemThread (final Runnable runnable, final String threadName) {
if (runnable == null) {
SYSTEM_UTIL_LOGGER.warn("Runnable is required.");
return;
}
if (runnable != null && StringUtils.isEmpty(threadName) == false
&& IlluminatiConstant.SYSTEM_THREAD_MAP.containsKey(threadName) == false) {
final Thread newThread = new Thread(runnable);

if (StringUtils.isEmpty(threadName)) {
SYSTEM_UTIL_LOGGER.warn("threadName is required.");
return;
}
if (!"debug".equalsIgnoreCase(threadName)) {
newThread.setName(threadName);
}
newThread.setDaemon(true);
newThread.start();

if (IlluminatiConstant.SYSTEM_THREAD_MAP.containsKey(threadName)) {
SYSTEM_UTIL_LOGGER.warn(threadName + " thread is already exists.");
return;
}
IlluminatiConstant.SYSTEM_THREAD_MAP.put(threadName, newThread);
} else {
if (runnable == null) {
SYSTEM_UTIL_LOGGER.warn("Runnable is required.");
}

final Thread newThread = new Thread(runnable);
if (StringUtils.isEmpty(threadName)) {
SYSTEM_UTIL_LOGGER.warn("threadName is required.");
}

if (!"debug".equalsIgnoreCase(threadName)) {
newThread.setName(threadName);
if (IlluminatiConstant.SYSTEM_THREAD_MAP.containsKey(threadName) == true) {
SYSTEM_UTIL_LOGGER.warn(threadName + " thread is already exists.");
}
}
newThread.setDaemon(true);
newThread.start();

IlluminatiConstant.SYSTEM_THREAD_MAP.put(threadName, newThread);
}

public static void createThreadStatusDebugThread () {
// debug illuminati buffer queue
if (IlluminatiConstant.ILLUMINATI_DEBUG == true) {
if (IlluminatiConstant.ILLUMINATI_DEBUG == true && SYSTEM_UTIL_LOGGER.isInfoEnabled() == true) {
final Runnable threadCheckRunnable = new Runnable() {
public void run() {
while (true) {
Expand Down
8 changes: 4 additions & 4 deletions illuminati-client/illuminati-client-elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-elasticsearch</artifactId>
<version>0.7.9.1</version>
<version>0.7.9.2</version>
</dependency>
```

## add to Gradle Dependency
* Gradle

```java
compile 'com.leekyoungil.illuminati:illuminati-client-elasticsearch:0.7.9.1'
compile 'com.leekyoungil.illuminati:illuminati-client-elasticsearch:0.7.9.2'
```

===============================================================================
Expand All @@ -42,13 +42,13 @@ compile 'com.leekyoungil.illuminati:illuminati-client-elasticsearch:0.7.9.1'
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-elasticsearch</artifactId>
<version>0.7.9.1</version>
<version>0.7.9.2</version>
</dependency>
```

## Gradle Dependency 추가
* Gradle

```java
compile 'com.leekyoungil.illuminati:illuminati-client-elasticsearch:0.7.9.1'
compile 'com.leekyoungil.illuminati:illuminati-client-elasticsearch:0.7.9.2'
```
4 changes: 2 additions & 2 deletions illuminati-client/illuminati-client-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-elasticsearch</artifactId>
<version>0.7.9.1</version>
<version>0.7.9.2</version>
<packaging>jar</packaging>

<properties>
Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-common</artifactId>
<version>1.2.1</version>
<version>1.2.3</version>
<scope>compile</scope>
</dependency>

Expand Down
8 changes: 4 additions & 4 deletions illuminati-client/illuminati-client-jscollector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-jscollector</artifactId>
<version>0.5.3</version>
<version>0.5.5</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -36,7 +36,7 @@ repositories {
jcenter()
}

compile 'com.leekyoungil.illuminati:illuminati-client-jscollector:0.5.3'
compile 'com.leekyoungil.illuminati:illuminati-client-jscollector:0.5.5'
```

## 2. add to Javascript in HTML & initialization
Expand Down Expand Up @@ -113,7 +113,7 @@ compile 'com.leekyoungil.illuminati:illuminati-client-jscollector:0.5.3'
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-jscollector</artifactId>
<version>0.5.3</version>
<version>0.5.5</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -126,7 +126,7 @@ repositories {
jcenter()
}

compile 'com.leekyoungil.illuminati:illuminati-client-jscollector:0.5.3'
compile 'com.leekyoungil.illuminati:illuminati-client-jscollector:0.5.5'
```

## 2. Javascript 추가 & 초기화
Expand Down
4 changes: 2 additions & 2 deletions illuminati-client/illuminati-client-jscollector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-jscollector</artifactId>
<version>0.5.4</version>
<version>0.5.5</version>
<packaging>jar</packaging>

<properties>
Expand All @@ -29,7 +29,7 @@
<dependency>
<groupId>com.leekyoungil.illuminati</groupId>
<artifactId>illuminati-client-common</artifactId>
<version>1.2.1</version>
<version>1.2.3</version>
<scope>provided</scope>
</dependency>

Expand Down
Loading

0 comments on commit 8dd5ca0

Please sign in to comment.