Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿信在这里
SkyWalking
提交
3773c468
S
SkyWalking
项目概览
阿信在这里
/
SkyWalking
与 Fork 源项目一致
Fork自
山不在高_有仙则灵 / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3773c468
编写于
9月 10, 2017
作者:
P
pengys5
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into feature/cluster
上级
479b421a
4b8b2372
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
54 addition
and
100 deletion
+54
-100
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandler.java
...ector/agentjvm/grpc/handler/JVMMetricsServiceHandler.java
+1
-2
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricEsDAO.java
...agentjvm/worker/memorypool/dao/MemoryPoolMetricEsDAO.java
+2
-3
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricEsTableDefine.java
...rker/memorypool/define/MemoryPoolMetricEsTableDefine.java
+1
-2
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricH2TableDefine.java
...rker/memorypool/define/MemoryPoolMetricH2TableDefine.java
+1
-2
apm-collector/apm-collector-agentjvm/src/test/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandlerTestCase.java
...entjvm/grpc/handler/JVMMetricsServiceHandlerTestCase.java
+0
-1
apm-collector/apm-collector-storage/src/main/java/org/skywalking/apm/collector/storage/define/jvm/MemoryPoolMetricDataDefine.java
...lector/storage/define/jvm/MemoryPoolMetricDataDefine.java
+11
-20
apm-collector/apm-collector-storage/src/main/java/org/skywalking/apm/collector/storage/define/jvm/MemoryPoolMetricTable.java
...m/collector/storage/define/jvm/MemoryPoolMetricTable.java
+0
-1
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/IMemoryPoolMetricDAO.java
...skywalking/apm/collector/ui/dao/IMemoryPoolMetricDAO.java
+2
-2
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/MemoryPoolMetricEsDAO.java
...kywalking/apm/collector/ui/dao/MemoryPoolMetricEsDAO.java
+4
-5
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/InstanceJVMService.java
...ywalking/apm/collector/ui/service/InstanceJVMService.java
+24
-56
apm-network/src/main/proto/JVMMetricsService.proto
apm-network/src/main/proto/JVMMetricsService.proto
+4
-5
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/jvm/gc/GCProvider.java
...java/org/skywalking/apm/agent/core/jvm/gc/GCProvider.java
+4
-1
未找到文件。
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandler.java
浏览文件 @
3773c468
...
...
@@ -111,10 +111,9 @@ public class JVMMetricsServiceHandler extends JVMMetricsServiceGrpc.JVMMetricsSe
memoryPools
.
forEach
(
memoryPool
->
{
MemoryPoolMetricDataDefine
.
MemoryPoolMetric
memoryPoolMetric
=
new
MemoryPoolMetricDataDefine
.
MemoryPoolMetric
();
memoryPoolMetric
.
setId
(
timeBucket
+
Const
.
ID_SPLIT
+
instanceId
+
Const
.
ID_SPLIT
+
memoryPool
.
getIsHeap
()
+
Const
.
ID_SPLIT
+
String
.
valueOf
(
memoryPool
.
getType
().
getNumber
()));
memoryPoolMetric
.
setId
(
timeBucket
+
Const
.
ID_SPLIT
+
instanceId
+
Const
.
ID_SPLIT
+
String
.
valueOf
(
memoryPool
.
getType
().
getNumber
()));
memoryPoolMetric
.
setInstanceId
(
instanceId
);
memoryPoolMetric
.
setPoolType
(
memoryPool
.
getType
().
getNumber
());
memoryPoolMetric
.
setHeap
(
memoryPool
.
getIsHeap
());
memoryPoolMetric
.
setInit
(
memoryPool
.
getInit
());
memoryPoolMetric
.
setMax
(
memoryPool
.
getMax
());
memoryPoolMetric
.
setUsed
(
memoryPool
.
getUsed
());
...
...
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/dao/MemoryPoolMetricEsDAO.java
浏览文件 @
3773c468
...
...
@@ -4,11 +4,11 @@ import java.util.HashMap;
import
java.util.Map
;
import
org.elasticsearch.action.index.IndexRequestBuilder
;
import
org.elasticsearch.action.update.UpdateRequestBuilder
;
import
org.skywalking.apm.collector.core.stream.Data
;
import
org.skywalking.apm.collector.storage.define.DataDefine
;
import
org.skywalking.apm.collector.storage.define.jvm.MemoryPoolMetricTable
;
import
org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO
;
import
org.skywalking.apm.collector.stream.worker.impl.dao.IPersistenceDAO
;
import
org.skywalking.apm.collector.core.stream.Data
;
import
org.skywalking.apm.collector.storage.define.DataDefine
;
/**
* @author pengys5
...
...
@@ -23,7 +23,6 @@ public class MemoryPoolMetricEsDAO extends EsDAO implements IMemoryPoolMetricDAO
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
MemoryPoolMetricTable
.
COLUMN_INSTANCE_ID
,
data
.
getDataInteger
(
0
));
source
.
put
(
MemoryPoolMetricTable
.
COLUMN_POOL_TYPE
,
data
.
getDataInteger
(
1
));
source
.
put
(
MemoryPoolMetricTable
.
COLUMN_IS_HEAP
,
data
.
getDataBoolean
(
0
));
source
.
put
(
MemoryPoolMetricTable
.
COLUMN_INIT
,
data
.
getDataLong
(
0
));
source
.
put
(
MemoryPoolMetricTable
.
COLUMN_MAX
,
data
.
getDataLong
(
1
));
source
.
put
(
MemoryPoolMetricTable
.
COLUMN_USED
,
data
.
getDataLong
(
2
));
...
...
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricEsTableDefine.java
浏览文件 @
3773c468
package
org.skywalking.apm.collector.agentjvm.worker.memorypool.define
;
import
org.skywalking.apm.collector.storage.define.jvm.MemoryPoolMetricTable
;
import
org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchColumnDefine
;
import
org.skywalking.apm.collector.storage.elasticsearch.define.ElasticSearchTableDefine
;
import
org.skywalking.apm.collector.storage.define.jvm.MemoryPoolMetricTable
;
/**
* @author pengys5
...
...
@@ -28,7 +28,6 @@ public class MemoryPoolMetricEsTableDefine extends ElasticSearchTableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
ElasticSearchColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_INSTANCE_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_POOL_TYPE
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_IS_HEAP
,
ElasticSearchColumnDefine
.
Type
.
Boolean
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_INIT
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_MAX
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_USED
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
...
...
apm-collector/apm-collector-agentjvm/src/main/java/org/skywalking/apm/collector/agentjvm/worker/memorypool/define/MemoryPoolMetricH2TableDefine.java
浏览文件 @
3773c468
package
org.skywalking.apm.collector.agentjvm.worker.memorypool.define
;
import
org.skywalking.apm.collector.storage.define.jvm.MemoryPoolMetricTable
;
import
org.skywalking.apm.collector.storage.h2.define.H2ColumnDefine
;
import
org.skywalking.apm.collector.storage.h2.define.H2TableDefine
;
import
org.skywalking.apm.collector.storage.define.jvm.MemoryPoolMetricTable
;
/**
* @author pengys5
...
...
@@ -17,7 +17,6 @@ public class MemoryPoolMetricH2TableDefine extends H2TableDefine {
addColumn
(
new
H2ColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_ID
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_INSTANCE_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_POOL_TYPE
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_IS_HEAP
,
H2ColumnDefine
.
Type
.
Boolean
.
name
()));
addColumn
(
new
H2ColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_INIT
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_MAX
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
MemoryPoolMetricTable
.
COLUMN_USED
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
...
...
apm-collector/apm-collector-agentjvm/src/test/java/org/skywalking/apm/collector/agentjvm/grpc/handler/JVMMetricsServiceHandlerTestCase.java
浏览文件 @
3773c468
...
...
@@ -100,7 +100,6 @@ public class JVMMetricsServiceHandlerTestCase {
private
static
MemoryPool
.
Builder
buildMemoryPoolMetric
(
PoolType
poolType
,
boolean
isHeap
)
{
MemoryPool
.
Builder
builder
=
MemoryPool
.
newBuilder
();
builder
.
setType
(
poolType
);
builder
.
setIsHeap
(
isHeap
);
builder
.
setInit
(
20
);
builder
.
setMax
(
100
);
builder
.
setUsed
(
50
);
...
...
apm-collector/apm-collector-storage/src/main/java/org/skywalking/apm/collector/storage/define/jvm/MemoryPoolMetricDataDefine.java
浏览文件 @
3773c468
package
org.skywalking.apm.collector.storage.define.jvm
;
import
org.skywalking.apm.collector.core.framework.UnexpectedException
;
import
org.skywalking.apm.collector.remote.grpc.proto.RemoteData
;
import
org.skywalking.apm.collector.storage.define.Attribute
;
import
org.skywalking.apm.collector.storage.define.AttributeType
;
import
org.skywalking.apm.collector.core.stream.Data
;
import
org.skywalking.apm.collector.storage.define.DataDefine
;
import
org.skywalking.apm.collector.core.stream.Transform
;
import
org.skywalking.apm.collector.core.stream.operate.CoverOperation
;
import
org.skywalking.apm.collector.core.stream.operate.NonOperation
;
import
org.skywalking.apm.collector.remote.grpc.proto.RemoteData
;
import
org.skywalking.apm.collector.storage.define.Attribute
;
import
org.skywalking.apm.collector.storage.define.AttributeType
;
import
org.skywalking.apm.collector.storage.define.DataDefine
;
/**
* @author pengys5
...
...
@@ -16,19 +16,18 @@ import org.skywalking.apm.collector.core.stream.operate.NonOperation;
public
class
MemoryPoolMetricDataDefine
extends
DataDefine
{
@Override
protected
int
initialCapacity
()
{
return
9
;
return
8
;
}
@Override
protected
void
attributeDefine
()
{
addAttribute
(
0
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_ID
,
AttributeType
.
STRING
,
new
NonOperation
()));
addAttribute
(
1
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_INSTANCE_ID
,
AttributeType
.
INTEGER
,
new
CoverOperation
()));
addAttribute
(
2
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_POOL_TYPE
,
AttributeType
.
INTEGER
,
new
CoverOperation
()));
addAttribute
(
3
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_IS_HEAP
,
AttributeType
.
BOOLEAN
,
new
CoverOperation
()));
addAttribute
(
4
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_INIT
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
5
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_MAX
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
6
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_USED
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
7
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_COMMITTED
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
8
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_TIME_BUCKET
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
3
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_INIT
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
4
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_MAX
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
5
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_USED
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
6
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_COMMITTED
,
AttributeType
.
LONG
,
new
CoverOperation
()));
addAttribute
(
7
,
new
Attribute
(
MemoryPoolMetricTable
.
COLUMN_TIME_BUCKET
,
AttributeType
.
LONG
,
new
CoverOperation
()));
}
@Override
public
Object
deserialize
(
RemoteData
remoteData
)
{
...
...
@@ -43,19 +42,17 @@ public class MemoryPoolMetricDataDefine extends DataDefine {
private
String
id
;
private
int
instanceId
;
private
int
poolType
;
private
boolean
isHeap
;
private
long
init
;
private
long
max
;
private
long
used
;
private
long
committed
;
private
long
timeBucket
;
public
MemoryPoolMetric
(
String
id
,
int
instanceId
,
int
poolType
,
boolean
isHeap
,
long
init
,
long
max
,
public
MemoryPoolMetric
(
String
id
,
int
instanceId
,
int
poolType
,
long
init
,
long
max
,
long
used
,
long
committed
,
long
timeBucket
)
{
this
.
id
=
id
;
this
.
instanceId
=
instanceId
;
this
.
poolType
=
poolType
;
this
.
isHeap
=
isHeap
;
this
.
init
=
init
;
this
.
max
=
max
;
this
.
used
=
used
;
...
...
@@ -72,7 +69,6 @@ public class MemoryPoolMetricDataDefine extends DataDefine {
data
.
setDataString
(
0
,
this
.
id
);
data
.
setDataInteger
(
0
,
this
.
instanceId
);
data
.
setDataInteger
(
1
,
this
.
poolType
);
data
.
setDataBoolean
(
0
,
this
.
isHeap
);
data
.
setDataLong
(
0
,
this
.
init
);
data
.
setDataLong
(
1
,
this
.
max
);
data
.
setDataLong
(
2
,
this
.
used
);
...
...
@@ -85,7 +81,6 @@ public class MemoryPoolMetricDataDefine extends DataDefine {
this
.
id
=
data
.
getDataString
(
0
);
this
.
instanceId
=
data
.
getDataInteger
(
0
);
this
.
poolType
=
data
.
getDataInteger
(
1
);
this
.
isHeap
=
data
.
getDataBoolean
(
0
);
this
.
init
=
data
.
getDataLong
(
0
);
this
.
max
=
data
.
getDataLong
(
1
);
this
.
used
=
data
.
getDataLong
(
2
);
...
...
@@ -106,10 +101,6 @@ public class MemoryPoolMetricDataDefine extends DataDefine {
this
.
poolType
=
poolType
;
}
public
void
setHeap
(
boolean
heap
)
{
isHeap
=
heap
;
}
public
void
setInit
(
long
init
)
{
this
.
init
=
init
;
}
...
...
apm-collector/apm-collector-storage/src/main/java/org/skywalking/apm/collector/storage/define/jvm/MemoryPoolMetricTable.java
浏览文件 @
3773c468
...
...
@@ -9,7 +9,6 @@ public class MemoryPoolMetricTable extends CommonTable {
public
static
final
String
TABLE
=
"memory_pool_metric"
;
public
static
final
String
COLUMN_INSTANCE_ID
=
"instance_id"
;
public
static
final
String
COLUMN_POOL_TYPE
=
"pool_type"
;
public
static
final
String
COLUMN_IS_HEAP
=
"is_heap"
;
public
static
final
String
COLUMN_INIT
=
"init"
;
public
static
final
String
COLUMN_MAX
=
"max"
;
public
static
final
String
COLUMN_USED
=
"used"
;
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/IMemoryPoolMetricDAO.java
浏览文件 @
3773c468
...
...
@@ -6,7 +6,7 @@ import com.google.gson.JsonObject;
* @author pengys5
*/
public
interface
IMemoryPoolMetricDAO
{
JsonObject
getMetric
(
int
instanceId
,
long
timeBucket
,
boolean
isHeap
,
int
poolType
);
JsonObject
getMetric
(
int
instanceId
,
long
timeBucket
,
int
poolType
);
JsonObject
getMetric
(
int
instanceId
,
long
startTimeBucket
,
long
endTimeBucket
,
boolean
isHeap
,
int
poolType
);
JsonObject
getMetric
(
int
instanceId
,
long
startTimeBucket
,
long
endTimeBucket
,
int
poolType
);
}
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/dao/MemoryPoolMetricEsDAO.java
浏览文件 @
3773c468
...
...
@@ -16,8 +16,8 @@ import org.skywalking.apm.collector.storage.elasticsearch.dao.EsDAO;
*/
public
class
MemoryPoolMetricEsDAO
extends
EsDAO
implements
IMemoryPoolMetricDAO
{
@Override
public
JsonObject
getMetric
(
int
instanceId
,
long
timeBucket
,
boolean
isHeap
,
int
poolType
)
{
String
id
=
timeBucket
+
Const
.
ID_SPLIT
+
instanceId
+
Const
.
ID_SPLIT
+
isHeap
+
Const
.
ID_SPLIT
+
poolType
;
@Override
public
JsonObject
getMetric
(
int
instanceId
,
long
timeBucket
,
int
poolType
)
{
String
id
=
timeBucket
+
Const
.
ID_SPLIT
+
instanceId
+
Const
.
ID_SPLIT
+
poolType
;
GetResponse
getResponse
=
getClient
().
prepareGet
(
MemoryPoolMetricTable
.
TABLE
,
id
).
get
();
JsonObject
metric
=
new
JsonObject
();
...
...
@@ -33,14 +33,13 @@ public class MemoryPoolMetricEsDAO extends EsDAO implements IMemoryPoolMetricDAO
return
metric
;
}
@Override
public
JsonObject
getMetric
(
int
instanceId
,
long
startTimeBucket
,
long
endTimeBucket
,
boolean
isHeap
,
int
poolType
)
{
@Override
public
JsonObject
getMetric
(
int
instanceId
,
long
startTimeBucket
,
long
endTimeBucket
,
int
poolType
)
{
MultiGetRequestBuilder
prepareMultiGet
=
getClient
().
prepareMultiGet
();
long
timeBucket
=
startTimeBucket
;
do
{
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
addSecondForSecondTimeBucket
(
TimeBucketUtils
.
TimeBucketType
.
SECOND
.
name
(),
timeBucket
,
1
);
String
id
=
timeBucket
+
Const
.
ID_SPLIT
+
instanceId
+
Const
.
ID_SPLIT
+
isHeap
+
Const
.
ID_SPLIT
+
poolType
;
String
id
=
timeBucket
+
Const
.
ID_SPLIT
+
instanceId
+
Const
.
ID_SPLIT
+
poolType
;
prepareMultiGet
.
add
(
MemoryPoolMetricTable
.
TABLE
,
MemoryPoolMetricTable
.
TABLE_TYPE
,
id
);
}
while
(
timeBucket
<=
endTimeBucket
);
...
...
apm-collector/apm-collector-ui/src/main/java/org/skywalking/apm/collector/ui/service/InstanceJVMService.java
浏览文件 @
3773c468
...
...
@@ -30,11 +30,10 @@ public class InstanceJVMService {
IInstanceDAO
instanceDAO
=
(
IInstanceDAO
)
DAOContainer
.
INSTANCE
.
get
(
IInstanceDAO
.
class
.
getName
());
InstanceDataDefine
.
Instance
instance
=
instanceDAO
.
getInstance
(
instanceId
);
if
(
ObjectUtils
.
isEmpty
(
instance
))
{
throw
new
UnexpectedException
(
"instance id: "
+
instance
+
" not exist."
);
throw
new
UnexpectedException
(
"instance id: "
+
instance
Id
+
" not exist."
);
}
JsonObject
response
=
gson
.
fromJson
(
instance
.
getOsInfo
(),
JsonObject
.
class
);
return
response
;
return
gson
.
fromJson
(
instance
.
getOsInfo
(),
JsonObject
.
class
);
}
public
JsonObject
getInstanceJvmMetric
(
int
instanceId
,
Set
<
String
>
metricTypes
,
long
timeBucket
)
{
...
...
@@ -58,36 +57,21 @@ public class InstanceJVMService {
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheapmemory
.
name
()))
{
IMemoryMetricDAO
memoryMetricDAO
=
(
IMemoryMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapmemory
.
name
(),
memoryMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
false
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heap
permgen
.
name
()))
{
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
permgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heappermgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
true
,
PoolType
.
PERMGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heap
metaspace
.
name
()))
{
metrics
.
add
(
MetricType
.
permgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
PoolType
.
PERMGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
metaspace
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapmetaspace
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
true
,
PoolType
.
METASPACE_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heap
newgen
.
name
()))
{
metrics
.
add
(
MetricType
.
metaspace
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
PoolType
.
METASPACE_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
newgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapnewgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
true
,
PoolType
.
NEWGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heap
oldgen
.
name
()))
{
metrics
.
add
(
MetricType
.
newgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
PoolType
.
NEWGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
oldgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapoldgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
true
,
PoolType
.
OLDGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heap
survivor
.
name
()))
{
metrics
.
add
(
MetricType
.
oldgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
PoolType
.
OLDGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
survivor
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapsurvivor
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
true
,
PoolType
.
SURVIVOR_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheappermgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheappermgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
false
,
PoolType
.
PERMGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheapmetaspace
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapmetaspace
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
false
,
PoolType
.
METASPACE_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheapnewgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapnewgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
false
,
PoolType
.
NEWGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheapoldgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapnewgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
false
,
PoolType
.
OLDGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheapsurvivor
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapsurvivor
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
false
,
PoolType
.
OLDGEN_USAGE_VALUE
));
metrics
.
add
(
MetricType
.
survivor
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
timeBucket
,
PoolType
.
SURVIVOR_USAGE_VALUE
));
}
else
{
throw
new
UnexpectedException
(
"unexpected metric type"
);
}
...
...
@@ -117,36 +101,21 @@ public class InstanceJVMService {
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheapmemory
.
name
()))
{
IMemoryMetricDAO
memoryMetricDAO
=
(
IMemoryMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapmemory
.
name
(),
memoryMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
false
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heappermgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heappermgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
true
,
PoolType
.
PERMGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heapmetaspace
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapmetaspace
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
true
,
PoolType
.
METASPACE_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heapnewgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapnewgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
true
,
PoolType
.
NEWGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heapoldgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapoldgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
true
,
PoolType
.
OLDGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
heapsurvivor
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
heapsurvivor
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
true
,
PoolType
.
SURVIVOR_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheappermgen
.
name
()))
{
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
permgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheappermgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
false
,
PoolType
.
PERMGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheap
metaspace
.
name
()))
{
metrics
.
add
(
MetricType
.
permgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
PoolType
.
PERMGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
metaspace
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapmetaspace
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
false
,
PoolType
.
METASPACE_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
n
onheapn
ewgen
.
name
()))
{
metrics
.
add
(
MetricType
.
metaspace
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
PoolType
.
METASPACE_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
newgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
n
onheapnewgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
false
,
PoolType
.
NEWGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheap
oldgen
.
name
()))
{
metrics
.
add
(
MetricType
.
n
ewgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
PoolType
.
NEWGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
oldgen
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapnewgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
false
,
PoolType
.
OLDGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
nonheap
survivor
.
name
()))
{
metrics
.
add
(
MetricType
.
oldgen
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
PoolType
.
OLDGEN_USAGE_VALUE
));
}
else
if
(
metricType
.
toLowerCase
().
equals
(
MetricType
.
survivor
.
name
()))
{
IMemoryPoolMetricDAO
memoryPoolMetricDAO
=
(
IMemoryPoolMetricDAO
)
DAOContainer
.
INSTANCE
.
get
(
IMemoryPoolMetricDAO
.
class
.
getName
());
metrics
.
add
(
MetricType
.
nonheapsurvivor
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
false
,
PoolType
.
OLDGEN
_USAGE_VALUE
));
metrics
.
add
(
MetricType
.
survivor
.
name
(),
memoryPoolMetricDAO
.
getMetric
(
instanceId
,
startTimeBucket
,
endTimeBucket
,
PoolType
.
SURVIVOR
_USAGE_VALUE
));
}
else
{
throw
new
UnexpectedException
(
"unexpected metric type"
);
}
...
...
@@ -156,8 +125,7 @@ public class InstanceJVMService {
}
public
enum
MetricType
{
cpu
,
gc
,
tps
,
resptime
,
heapmemory
,
heappermgen
,
heapmetaspace
,
heapnewgen
,
heapoldgen
,
heapsurvivor
,
nonheapmemory
,
nonheappermgen
,
nonheapmetaspace
,
nonheapnewgen
,
nonheapoldgen
,
nonheapsurvivor
cpu
,
gc
,
tps
,
resptime
,
heapmemory
,
nonheapmemory
,
permgen
,
metaspace
,
newgen
,
oldgen
,
survivor
}
}
apm-network/src/main/proto/JVMMetricsService.proto
浏览文件 @
3773c468
...
...
@@ -37,11 +37,10 @@ message Memory {
message
MemoryPool
{
PoolType
type
=
1
;
bool
isHeap
=
2
;
int64
init
=
3
;
int64
max
=
4
;
int64
used
=
5
;
int64
commited
=
6
;
int64
init
=
2
;
int64
max
=
3
;
int64
used
=
4
;
int64
commited
=
5
;
}
enum
PoolType
{
...
...
apm-sniffer/apm-agent-core/src/main/java/org/skywalking/apm/agent/core/jvm/gc/GCProvider.java
浏览文件 @
3773c468
...
...
@@ -24,7 +24,10 @@ public enum GCProvider {
break
;
}
}
this
.
metricAccessor
=
new
UnknowGC
();
if
(
metricAccessor
==
null
)
{
this
.
metricAccessor
=
new
UnknowGC
();
}
}
public
List
<
GC
>
getGCList
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录