forked from ltsopensource/light-task-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7ba66e
commit bf24bc0
Showing
24 changed files
with
584 additions
and
58 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
7 changes: 6 additions & 1 deletion
7
lts-admin/src/main/java/com/lts/admin/access/face/BackendJVMGCAccess.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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
package com.lts.admin.access.face; | ||
|
||
import com.lts.admin.request.JvmDataReq; | ||
import com.lts.admin.request.MDataPaginationReq; | ||
import com.lts.monitor.access.domain.JVMGCDataPo; | ||
import com.lts.monitor.access.face.JVMGCAccess; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Robert HG ([email protected]) on 9/28/15. | ||
*/ | ||
public interface BackendJVMGCAccess extends JVMGCAccess{ | ||
public interface BackendJVMGCAccess extends JVMGCAccess { | ||
|
||
void delete(JvmDataReq request); | ||
|
||
List<JVMGCDataPo> queryAvg(MDataPaginationReq request); | ||
} |
5 changes: 5 additions & 0 deletions
5
lts-admin/src/main/java/com/lts/admin/access/face/BackendJVMMemoryAccess.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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
package com.lts.admin.access.face; | ||
|
||
import com.lts.admin.request.JvmDataReq; | ||
import com.lts.admin.request.MDataPaginationReq; | ||
import com.lts.monitor.access.domain.JVMMemoryDataPo; | ||
import com.lts.monitor.access.face.JVMMemoryAccess; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Robert HG ([email protected]) on 9/28/15. | ||
*/ | ||
public interface BackendJVMMemoryAccess extends JVMMemoryAccess{ | ||
|
||
void delete(JvmDataReq request); | ||
|
||
List<JVMMemoryDataPo> queryAvg(MDataPaginationReq request); | ||
} |
6 changes: 6 additions & 0 deletions
6
lts-admin/src/main/java/com/lts/admin/access/face/BackendJVMThreadAccess.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 |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package com.lts.admin.access.face; | ||
|
||
import com.lts.admin.request.JvmDataReq; | ||
import com.lts.admin.request.MDataPaginationReq; | ||
import com.lts.monitor.access.domain.JVMThreadDataPo; | ||
import com.lts.monitor.access.face.JVMThreadAccess; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Robert HG ([email protected]) on 9/28/15. | ||
*/ | ||
public interface BackendJVMThreadAccess extends JVMThreadAccess { | ||
|
||
void delete(JvmDataReq request); | ||
|
||
List<JVMThreadDataPo> queryAvg(MDataPaginationReq request); | ||
|
||
} |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package com.lts.admin.access.mysql; | ||
|
||
import com.lts.admin.access.RshHandler; | ||
import com.lts.admin.access.face.BackendJVMGCAccess; | ||
import com.lts.admin.request.JvmDataReq; | ||
import com.lts.admin.request.MDataPaginationReq; | ||
import com.lts.core.cluster.Config; | ||
import com.lts.monitor.access.domain.JVMGCDataPo; | ||
import com.lts.monitor.access.mysql.MysqlJVMGCAccess; | ||
import com.lts.store.jdbc.builder.DeleteSql; | ||
import com.lts.store.jdbc.builder.SelectSql; | ||
import com.lts.store.jdbc.builder.WhereSql; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Robert HG ([email protected]) on 3/10/16. | ||
*/ | ||
|
@@ -26,10 +32,39 @@ public void delete(JvmDataReq request) { | |
.doDelete(); | ||
} | ||
|
||
@Override | ||
public List<JVMGCDataPo> queryAvg(MDataPaginationReq request) { | ||
return new SelectSql(getSqlTemplate()) | ||
.select() | ||
.columns("timestamp", | ||
"AVG(young_gc_collection_count) AS young_gc_collection_count", | ||
"AVG(young_gc_collection_time) AS young_gc_collection_time", | ||
"AVG(full_gc_collection_count) AS full_gc_collection_count", | ||
"AVG(full_gc_collection_time) AS full_gc_collection_time", | ||
"AVG(span_young_gc_collection_count) AS span_young_gc_collection_count", | ||
"AVG(span_young_gc_collection_time) AS span_young_gc_collection_time", | ||
"AVG(span_full_gc_collection_count) span_full_gc_collection_count", | ||
"AVG(span_full_gc_collection_time) span_full_gc_collection_time") | ||
.from() | ||
.table(getTableName()) | ||
.whereSql(buildWhereSql(request)) | ||
.groupBy(" timestamp ASC ") | ||
.limit(request.getStart(), request.getLimit()) | ||
.list(RshHandler.JVM_GC_SUM_M_DATA_RSH); | ||
} | ||
|
||
public WhereSql buildWhereSql(JvmDataReq req) { | ||
return new WhereSql() | ||
.andOnNotEmpty("identity = ?", req.getIdentity()) | ||
.andBetween("timestamp", req.getStartTime(), req.getEndTime()); | ||
|
||
} | ||
|
||
public WhereSql buildWhereSql(MDataPaginationReq request) { | ||
return new WhereSql() | ||
.andOnNotNull("id = ?", request.getId()) | ||
.andOnNotEmpty("identity = ?", request.getIdentity()) | ||
.andOnNotEmpty("node_group = ?", request.getNodeGroup()) | ||
.andBetween("timestamp", request.getStartTime(), request.getEndTime()); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package com.lts.admin.access.mysql; | ||
|
||
import com.lts.admin.access.RshHandler; | ||
import com.lts.admin.access.face.BackendJVMMemoryAccess; | ||
import com.lts.admin.request.JvmDataReq; | ||
import com.lts.admin.request.MDataPaginationReq; | ||
import com.lts.core.cluster.Config; | ||
import com.lts.monitor.access.domain.JVMMemoryDataPo; | ||
import com.lts.monitor.access.mysql.MysqlJVMMemoryAccess; | ||
import com.lts.store.jdbc.builder.DeleteSql; | ||
import com.lts.store.jdbc.builder.SelectSql; | ||
import com.lts.store.jdbc.builder.WhereSql; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Robert HG ([email protected]) on 3/9/16. | ||
*/ | ||
|
@@ -26,10 +32,55 @@ public void delete(JvmDataReq request) { | |
.doDelete(); | ||
} | ||
|
||
@Override | ||
public List<JVMMemoryDataPo> queryAvg(MDataPaginationReq request) { | ||
return new SelectSql(getSqlTemplate()) | ||
.select() | ||
.columns("timestamp", | ||
"AVG(heap_memory_committed) AS heap_memory_committed", | ||
"AVG(heap_memory_init) AS heap_memory_init", | ||
"AVG(heap_memory_max) AS heap_memory_max", | ||
"AVG(heap_memory_used) AS heap_memory_used", | ||
"AVG(non_heap_memory_committed) AS non_heap_memory_committed", | ||
"AVG(non_heap_memory_init) AS non_heap_memory_init", | ||
"AVG(non_heap_memory_max) AS non_heap_memory_max", | ||
"AVG(non_heap_memory_used) AS non_heap_memory_used", | ||
"AVG(perm_gen_committed) AS perm_gen_committed", | ||
"AVG(perm_gen_init) AS perm_gen_init", | ||
"AVG(perm_gen_max) AS perm_gen_max", | ||
"AVG(perm_gen_used) AS perm_gen_used", | ||
"AVG(old_gen_committed) AS old_gen_committed", | ||
"AVG(old_gen_init) AS old_gen_init", | ||
"AVG(old_gen_max) AS old_gen_max", | ||
"AVG(old_gen_used) AS old_gen_used", | ||
"AVG(eden_space_committed) AS eden_space_committed", | ||
"AVG(eden_space_init) AS eden_space_init", | ||
"AVG(eden_space_max) AS eden_space_max", | ||
"AVG(eden_space_used) AS eden_space_used", | ||
"AVG(survivor_committed) AS survivor_committed", | ||
"AVG(survivor_init) AS survivor_init", | ||
"AVG(survivor_max) AS survivor_max", | ||
"AVG(survivor_used) AS survivor_used") | ||
.from() | ||
.table(getTableName()) | ||
.whereSql(buildWhereSql(request)) | ||
.groupBy(" timestamp ASC ") | ||
.limit(request.getStart(), request.getLimit()) | ||
.list(RshHandler.JVM_MEMORY_SUM_M_DATA_RSH); | ||
} | ||
|
||
public WhereSql buildWhereSql(JvmDataReq req) { | ||
return new WhereSql() | ||
.andOnNotEmpty("identity = ?", req.getIdentity()) | ||
.andBetween("timestamp", req.getStartTime(), req.getEndTime()); | ||
|
||
} | ||
|
||
public WhereSql buildWhereSql(MDataPaginationReq request) { | ||
return new WhereSql() | ||
.andOnNotNull("id = ?", request.getId()) | ||
.andOnNotEmpty("identity = ?", request.getIdentity()) | ||
.andOnNotEmpty("node_group = ?", request.getNodeGroup()) | ||
.andBetween("timestamp", request.getStartTime(), request.getEndTime()); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package com.lts.admin.access.mysql; | ||
|
||
import com.lts.admin.access.RshHandler; | ||
import com.lts.admin.access.face.BackendJVMThreadAccess; | ||
import com.lts.admin.request.JvmDataReq; | ||
import com.lts.admin.request.MDataPaginationReq; | ||
import com.lts.core.cluster.Config; | ||
import com.lts.monitor.access.domain.JVMThreadDataPo; | ||
import com.lts.monitor.access.mysql.MysqlJVMThreadAccess; | ||
import com.lts.store.jdbc.builder.DeleteSql; | ||
import com.lts.store.jdbc.builder.SelectSql; | ||
import com.lts.store.jdbc.builder.WhereSql; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Robert HG ([email protected]) on 3/9/16. | ||
*/ | ||
|
@@ -26,10 +32,36 @@ public void delete(JvmDataReq request) { | |
.doDelete(); | ||
} | ||
|
||
@Override | ||
public List<JVMThreadDataPo> queryAvg(MDataPaginationReq request) { | ||
return new SelectSql(getSqlTemplate()) | ||
.select() | ||
.columns("timestamp", | ||
"AVG(daemon_thread_count) AS daemon_thread_count", | ||
"AVG(thread_count) AS thread_count", | ||
"AVG(total_started_thread_count) AS total_started_thread_count", | ||
"AVG(dead_locked_thread_count) AS dead_locked_thread_count", | ||
"AVG(process_cpu_time_rate) AS process_cpu_time_rate") | ||
.from() | ||
.table(getTableName()) | ||
.whereSql(buildWhereSql(request)) | ||
.groupBy(" timestamp ASC ") | ||
.limit(request.getStart(), request.getLimit()) | ||
.list(RshHandler.JVM_THREAD_SUM_M_DATA_RSH); | ||
} | ||
|
||
public WhereSql buildWhereSql(JvmDataReq req) { | ||
return new WhereSql() | ||
.andOnNotEmpty("identity = ?", req.getIdentity()) | ||
.andBetween("timestamp", req.getStartTime(), req.getEndTime()); | ||
|
||
} | ||
|
||
public WhereSql buildWhereSql(MDataPaginationReq request) { | ||
return new WhereSql() | ||
.andOnNotNull("id = ?", request.getId()) | ||
.andOnNotEmpty("identity = ?", request.getIdentity()) | ||
.andOnNotEmpty("node_group = ?", request.getNodeGroup()) | ||
.andBetween("timestamp", request.getStartTime(), request.getEndTime()); | ||
} | ||
} |
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 |
---|---|---|
|
@@ -17,9 +17,9 @@ | |
/** | ||
* Robert HG ([email protected]) on 6/5/15. | ||
*/ | ||
public class BackendRegistryService implements InitializingBean { | ||
public class BackendRegistrySrv implements InitializingBean { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(BackendRegistryService.class); | ||
private static final Logger LOGGER = LoggerFactory.getLogger(BackendRegistrySrv.class); | ||
@Autowired | ||
private BackendAppContext appContext; | ||
private Registry registry; | ||
|
12 changes: 12 additions & 0 deletions
12
lts-admin/src/main/java/com/lts/admin/request/JVMType.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,12 @@ | ||
package com.lts.admin.request; | ||
|
||
/** | ||
* Created by hugui.hg on 3/13/16. | ||
*/ | ||
public enum JVMType { | ||
|
||
GC, | ||
MEMORY, | ||
THREAD | ||
|
||
} |
Oops, something went wrong.