Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
8361f415
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
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,发现更多精彩内容 >>
提交
8361f415
编写于
1月 09, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CPU metric pyramid aggregate test successful.
上级
69bdfbad
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
316 addition
and
29 deletion
+316
-29
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java
...agent/grpc/provider/handler/JVMMetricsServiceHandler.java
+1
-1
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricServiceHandlerTestCase.java
...rpc/provider/handler/JVMMetricServiceHandlerTestCase.java
+9
-0
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java
...ector/analysis/jvm/provider/service/CpuMetricService.java
+6
-1
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java
...is/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java
+4
-3
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java
...s/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java
+4
-3
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java
...ector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java
+40
-0
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricTransformNode.java
...jvm/provider/worker/cpu/CpuMinuteMetricTransformNode.java
+4
-3
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java
.../jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java
+4
-3
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java
...pache/skywalking/apm/collector/storage/StorageModule.java
+8
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetric.java
...skywalking/apm/collector/storage/table/jvm/CpuMetric.java
+11
-2
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetricTable.java
...lking/apm/collector/storage/table/jvm/CpuMetricTable.java
+1
-1
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java
...ing/apm/collector/storage/es/StorageModuleEsProvider.java
+12
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpump/AbstractCpuMetricEsPersistenceDAO.java
...orage/es/dao/cpump/AbstractCpuMetricEsPersistenceDAO.java
+12
-1
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/AbstractCpuMetricEsTableDefine.java
...storage/es/define/cpu/AbstractCpuMetricEsTableDefine.java
+8
-10
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuDayMetricEsTableDefine.java
...ctor/storage/es/define/cpu/CpuDayMetricEsTableDefine.java
+37
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuHourMetricEsTableDefine.java
...tor/storage/es/define/cpu/CpuHourMetricEsTableDefine.java
+37
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMinuteMetricEsTableDefine.java
...r/storage/es/define/cpu/CpuMinuteMetricEsTableDefine.java
+37
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMonthMetricEsTableDefine.java
...or/storage/es/define/cpu/CpuMonthMetricEsTableDefine.java
+37
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuSecondMetricEsTableDefine.java
...r/storage/es/define/cpu/CpuSecondMetricEsTableDefine.java
+37
-0
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/defines/storage.define
...ovider/src/main/resources/META-INF/defines/storage.define
+7
-1
未找到文件。
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/main/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricsServiceHandler.java
浏览文件 @
8361f415
...
...
@@ -67,7 +67,7 @@ public class JVMMetricsServiceHandler extends JVMMetricsServiceGrpc.JVMMetricsSe
request
.
getMetricsList
().
forEach
(
metric
->
{
long
time
=
TimeBucketUtils
.
INSTANCE
.
getSecondTimeBucket
(
metric
.
getTime
());
// sendToInstanceHeartBeatService(instanceId, metric.getTime());
//
sendToCpuMetricService(instanceId, time, metric.getCpu());
sendToCpuMetricService
(
instanceId
,
time
,
metric
.
getCpu
());
sendToMemoryMetricService
(
instanceId
,
time
,
metric
.
getMemoryList
());
sendToMemoryPoolMetricService
(
instanceId
,
time
,
metric
.
getMemoryPoolList
());
sendToGCMetricService
(
instanceId
,
time
,
metric
.
getGcList
());
...
...
apm-collector/apm-collector-agent/agent-grpc/agent-grpc-provider/src/test/java/org/apache/skywalking/apm/collector/agent/grpc/provider/handler/JVMMetricServiceHandlerTestCase.java
浏览文件 @
8361f415
...
...
@@ -20,6 +20,7 @@ package org.apache.skywalking.apm.collector.agent.grpc.provider.handler;
import
io.grpc.ManagedChannel
;
import
io.grpc.ManagedChannelBuilder
;
import
org.apache.skywalking.apm.network.proto.CPU
;
import
org.apache.skywalking.apm.network.proto.GC
;
import
org.apache.skywalking.apm.network.proto.GCPhrase
;
import
org.apache.skywalking.apm.network.proto.JVMMetric
;
...
...
@@ -44,6 +45,7 @@ public class JVMMetricServiceHandlerTestCase {
JVMMetric
.
Builder
metricBuilder
=
JVMMetric
.
newBuilder
();
metricBuilder
.
setTime
(
System
.
currentTimeMillis
());
buildCPUMetric
(
metricBuilder
);
buildGCMetric
(
metricBuilder
);
buildMemoryMetric
(
metricBuilder
);
buildMemoryPoolMetric
(
metricBuilder
);
...
...
@@ -82,4 +84,11 @@ public class JVMMetricServiceHandlerTestCase {
metricBuilder
.
addGc
(
builder
);
}
private
static
void
buildCPUMetric
(
JVMMetric
.
Builder
metricBuilder
)
{
CPU
.
Builder
builder
=
CPU
.
newBuilder
();
builder
.
setUsagePercent
(
20
);
metricBuilder
.
setCpu
(
builder
.
build
());
}
}
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/service/CpuMetricService.java
浏览文件 @
8361f415
...
...
@@ -45,10 +45,15 @@ public class CpuMetricService implements ICpuMetricService {
}
@Override
public
void
send
(
int
instanceId
,
long
timeBucket
,
double
usagePercent
)
{
String
metricId
=
String
.
valueOf
(
instanceId
);
String
id
=
timeBucket
+
Const
.
ID_SPLIT
+
metricId
;
CpuMetric
cpuMetric
=
new
CpuMetric
();
cpuMetric
.
setId
(
timeBucket
+
Const
.
ID_SPLIT
+
instanceId
);
cpuMetric
.
setId
(
id
);
cpuMetric
.
setMetricId
(
metricId
);
cpuMetric
.
setInstanceId
(
instanceId
);
cpuMetric
.
setUsagePercent
(
usagePercent
);
cpuMetric
.
setTimes
(
1L
);
cpuMetric
.
setTimeBucket
(
timeBucket
);
logger
.
debug
(
"push to cpu metric graph, id: {}"
,
cpuMetric
.
getId
());
...
...
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuDayMetricTransformNode.java
浏览文件 @
8361f415
...
...
@@ -36,9 +36,10 @@ public class CpuDayMetricTransformNode implements NodeProcessor<CpuMetric, CpuMe
@Override
public
void
process
(
CpuMetric
cpuMetric
,
Next
<
CpuMetric
>
next
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
secondToDay
(
cpuMetric
.
getTimeBucket
());
cpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
cpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
cpuMetric
);
CpuMetric
newCpuMetric
=
CpuMetricCopy
.
copy
(
cpuMetric
);
newCpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
newCpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
newCpuMetric
);
}
}
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuHourMetricTransformNode.java
浏览文件 @
8361f415
...
...
@@ -36,9 +36,10 @@ public class CpuHourMetricTransformNode implements NodeProcessor<CpuMetric, CpuM
@Override
public
void
process
(
CpuMetric
cpuMetric
,
Next
<
CpuMetric
>
next
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
secondToHour
(
cpuMetric
.
getTimeBucket
());
cpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
cpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
cpuMetric
);
CpuMetric
newCpuMetric
=
CpuMetricCopy
.
copy
(
cpuMetric
);
newCpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
newCpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
newCpuMetric
);
}
}
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMetricCopy.java
0 → 100644
浏览文件 @
8361f415
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.analysis.jvm.provider.worker.cpu
;
import
org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetric
;
/**
* @author peng-yongsheng
*/
public
class
CpuMetricCopy
{
public
static
CpuMetric
copy
(
CpuMetric
cpuMetric
)
{
CpuMetric
newCpuMetric
=
new
CpuMetric
();
newCpuMetric
.
setId
(
cpuMetric
.
getId
());
newCpuMetric
.
setMetricId
(
cpuMetric
.
getMetricId
());
newCpuMetric
.
setInstanceId
(
cpuMetric
.
getInstanceId
());
newCpuMetric
.
setUsagePercent
(
cpuMetric
.
getUsagePercent
());
newCpuMetric
.
setTimes
(
cpuMetric
.
getTimes
());
newCpuMetric
.
setTimeBucket
(
cpuMetric
.
getTimeBucket
());
return
newCpuMetric
;
}
}
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMinuteMetricTransformNode.java
浏览文件 @
8361f415
...
...
@@ -36,9 +36,10 @@ public class CpuMinuteMetricTransformNode implements NodeProcessor<CpuMetric, Cp
@Override
public
void
process
(
CpuMetric
cpuMetric
,
Next
<
CpuMetric
>
next
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
secondToMinute
(
cpuMetric
.
getTimeBucket
());
cpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
cpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
cpuMetric
);
CpuMetric
newCpuMetric
=
CpuMetricCopy
.
copy
(
cpuMetric
);
newCpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
newCpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
newCpuMetric
);
}
}
apm-collector/apm-collector-analysis/analysis-jvm/jvm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/jvm/provider/worker/cpu/CpuMonthMetricTransformNode.java
浏览文件 @
8361f415
...
...
@@ -36,9 +36,10 @@ public class CpuMonthMetricTransformNode implements NodeProcessor<CpuMetric, Cpu
@Override
public
void
process
(
CpuMetric
cpuMetric
,
Next
<
CpuMetric
>
next
)
{
long
timeBucket
=
TimeBucketUtils
.
INSTANCE
.
secondToMonth
(
cpuMetric
.
getTimeBucket
());
cpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
cpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
cpuMetric
);
CpuMetric
newCpuMetric
=
CpuMetricCopy
.
copy
(
cpuMetric
);
newCpuMetric
.
setId
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
cpuMetric
.
getMetricId
());
newCpuMetric
.
setTimeBucket
(
timeBucket
);
next
.
execute
(
newCpuMetric
);
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/StorageModule.java
浏览文件 @
8361f415
...
...
@@ -71,6 +71,10 @@ import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDA
import
org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuDayMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuHourMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuMinuteMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuMonthMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuSecondMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCDayMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCHourMetricPersistenceDAO
;
...
...
@@ -152,6 +156,10 @@ public class StorageModule extends Module {
private
void
addPersistenceDAO
(
List
<
Class
>
classes
)
{
classes
.
add
(
ICpuSecondMetricPersistenceDAO
.
class
);
classes
.
add
(
ICpuMinuteMetricPersistenceDAO
.
class
);
classes
.
add
(
ICpuHourMetricPersistenceDAO
.
class
);
classes
.
add
(
ICpuDayMetricPersistenceDAO
.
class
);
classes
.
add
(
ICpuMonthMetricPersistenceDAO
.
class
);
classes
.
add
(
IGCSecondMetricPersistenceDAO
.
class
);
classes
.
add
(
IGCMinuteMetricPersistenceDAO
.
class
);
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetric.java
浏览文件 @
8361f415
...
...
@@ -35,6 +35,7 @@ public class CpuMetric extends StreamData {
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
new
Column
(
CpuMetricTable
.
COLUMN_TIMES
,
new
AddOperation
()),
new
Column
(
CpuMetricTable
.
COLUMN_TIME_BUCKET
,
new
CoverOperation
()),
};
...
...
@@ -85,11 +86,19 @@ public class CpuMetric extends StreamData {
setDataDouble
(
0
,
usagePercent
);
}
public
Long
getTime
Bucket
()
{
public
Long
getTime
s
()
{
return
getDataLong
(
0
);
}
public
void
setTimes
(
Long
times
)
{
setDataLong
(
0
,
times
);
}
public
Long
getTimeBucket
()
{
return
getDataLong
(
1
);
}
public
void
setTimeBucket
(
Long
timeBucket
)
{
setDataLong
(
0
,
timeBucket
);
setDataLong
(
1
,
timeBucket
);
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/jvm/CpuMetricTable.java
浏览文件 @
8361f415
...
...
@@ -16,7 +16,6 @@
*
*/
package
org.apache.skywalking.apm.collector.storage.table.jvm
;
import
org.apache.skywalking.apm.collector.core.data.CommonTable
;
...
...
@@ -28,4 +27,5 @@ public class CpuMetricTable extends CommonTable {
public
static
final
String
TABLE
=
"cpu_metric"
;
public
static
final
String
COLUMN_INSTANCE_ID
=
"instance_id"
;
public
static
final
String
COLUMN_USAGE_PERCENT
=
"usage_percent"
;
public
static
final
String
COLUMN_TIMES
=
"times"
;
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/StorageModuleEsProvider.java
浏览文件 @
8361f415
...
...
@@ -80,6 +80,10 @@ import org.apache.skywalking.apm.collector.storage.dao.cache.IApplicationCacheDA
import
org.apache.skywalking.apm.collector.storage.dao.cache.IInstanceCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cache.INetworkAddressCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cache.IServiceNameCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuDayMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuHourMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuMinuteMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuMonthMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.cpump.ICpuSecondMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCDayMetricPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.gcmp.IGCHourMetricPersistenceDAO
;
...
...
@@ -171,6 +175,10 @@ import org.apache.skywalking.apm.collector.storage.es.dao.cache.ApplicationEsCac
import
org.apache.skywalking.apm.collector.storage.es.dao.cache.InstanceEsCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.cache.NetworkAddressEsCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.cache.ServiceNameEsCacheDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.cpump.CpuDayMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.cpump.CpuHourMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.cpump.CpuMinuteMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.cpump.CpuMonthMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.cpump.CpuSecondMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.gcmp.GCDayMetricEsPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.es.dao.gcmp.GCHourMetricEsPersistenceDAO
;
...
...
@@ -302,6 +310,10 @@ public class StorageModuleEsProvider extends ModuleProvider {
private
void
registerPersistenceDAO
()
throws
ServiceNotProvidedException
{
this
.
registerServiceImplementation
(
ICpuSecondMetricPersistenceDAO
.
class
,
new
CpuSecondMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
ICpuMinuteMetricPersistenceDAO
.
class
,
new
CpuMinuteMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
ICpuHourMetricPersistenceDAO
.
class
,
new
CpuHourMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
ICpuDayMetricPersistenceDAO
.
class
,
new
CpuDayMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
ICpuMonthMetricPersistenceDAO
.
class
,
new
CpuMonthMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IGCSecondMetricPersistenceDAO
.
class
,
new
GCSecondMetricEsPersistenceDAO
(
elasticSearchClient
));
this
.
registerServiceImplementation
(
IGCMinuteMetricPersistenceDAO
.
class
,
new
GCMinuteMetricEsPersistenceDAO
(
elasticSearchClient
));
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/dao/cpump/AbstractCpuMetricEsPersistenceDAO.java
浏览文件 @
8361f415
...
...
@@ -39,7 +39,17 @@ public abstract class AbstractCpuMetricEsPersistenceDAO extends AbstractPersiste
}
@Override
protected
final
CpuMetric
esDataToStreamData
(
Map
<
String
,
Object
>
source
)
{
return
null
;
CpuMetric
cpuMetric
=
new
CpuMetric
();
cpuMetric
.
setId
((
String
)
source
.
get
(
CpuMetricTable
.
COLUMN_ID
));
cpuMetric
.
setMetricId
((
String
)
source
.
get
(
CpuMetricTable
.
COLUMN_METRIC_ID
));
cpuMetric
.
setInstanceId
(((
Number
)
source
.
get
(
CpuMetricTable
.
COLUMN_INSTANCE_ID
)).
intValue
());
cpuMetric
.
setUsagePercent
(((
Number
)
source
.
get
(
CpuMetricTable
.
COLUMN_USAGE_PERCENT
)).
doubleValue
());
cpuMetric
.
setTimes
(((
Number
)
source
.
get
(
CpuMetricTable
.
COLUMN_TIMES
)).
longValue
());
cpuMetric
.
setTimeBucket
(((
Number
)
source
.
get
(
CpuMetricTable
.
COLUMN_TIME_BUCKET
)).
longValue
());
return
cpuMetric
;
}
@Override
protected
final
Map
<
String
,
Object
>
esStreamDataToEsData
(
CpuMetric
streamData
)
{
...
...
@@ -49,6 +59,7 @@ public abstract class AbstractCpuMetricEsPersistenceDAO extends AbstractPersiste
source
.
put
(
CpuMetricTable
.
COLUMN_INSTANCE_ID
,
streamData
.
getInstanceId
());
source
.
put
(
CpuMetricTable
.
COLUMN_USAGE_PERCENT
,
streamData
.
getUsagePercent
());
source
.
put
(
CpuMetricTable
.
COLUMN_TIMES
,
streamData
.
getTimes
());
source
.
put
(
CpuMetricTable
.
COLUMN_TIME_BUCKET
,
streamData
.
getTimeBucket
());
return
source
;
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/CpuMetricEsTableDefine.java
→
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/
cpu/Abstract
CpuMetricEsTableDefine.java
浏览文件 @
8361f415
...
...
@@ -16,8 +16,7 @@
*
*/
package
org.apache.skywalking.apm.collector.storage.es.define
;
package
org.apache.skywalking.apm.collector.storage.es.define.cpu
;
import
org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchColumnDefine
;
import
org.apache.skywalking.apm.collector.storage.es.base.define.ElasticSearchTableDefine
;
...
...
@@ -26,19 +25,18 @@ import org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable;
/**
* @author peng-yongsheng
*/
public
class
CpuMetricEsTableDefine
extends
ElasticSearchTableDefine
{
public
CpuMetricEsTableDefine
()
{
super
(
CpuMetricTable
.
TABLE
);
}
public
abstract
class
AbstractCpuMetricEsTableDefine
extends
ElasticSearchTableDefine
{
@Override
public
int
refreshInterval
(
)
{
return
1
;
public
AbstractCpuMetricEsTableDefine
(
String
name
)
{
super
(
name
)
;
}
@Override
public
void
initialize
()
{
@Override
public
final
void
initialize
()
{
addColumn
(
new
ElasticSearchColumnDefine
(
CpuMetricTable
.
COLUMN_ID
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
CpuMetricTable
.
COLUMN_METRIC_ID
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
CpuMetricTable
.
COLUMN_INSTANCE_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
CpuMetricTable
.
COLUMN_USAGE_PERCENT
,
ElasticSearchColumnDefine
.
Type
.
Double
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
CpuMetricTable
.
COLUMN_TIMES
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
CpuMetricTable
.
COLUMN_TIME_BUCKET
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuDayMetricEsTableDefine.java
0 → 100644
浏览文件 @
8361f415
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.es.define.cpu
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable
;
/**
* @author peng-yongsheng
*/
public
class
CpuDayMetricEsTableDefine
extends
AbstractCpuMetricEsTableDefine
{
public
CpuDayMetricEsTableDefine
()
{
super
(
CpuMetricTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Day
.
getName
());
}
@Override
public
int
refreshInterval
()
{
return
1
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuHourMetricEsTableDefine.java
0 → 100644
浏览文件 @
8361f415
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.es.define.cpu
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable
;
/**
* @author peng-yongsheng
*/
public
class
CpuHourMetricEsTableDefine
extends
AbstractCpuMetricEsTableDefine
{
public
CpuHourMetricEsTableDefine
()
{
super
(
CpuMetricTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Hour
.
getName
());
}
@Override
public
int
refreshInterval
()
{
return
1
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMinuteMetricEsTableDefine.java
0 → 100644
浏览文件 @
8361f415
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.es.define.cpu
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable
;
/**
* @author peng-yongsheng
*/
public
class
CpuMinuteMetricEsTableDefine
extends
AbstractCpuMetricEsTableDefine
{
public
CpuMinuteMetricEsTableDefine
()
{
super
(
CpuMetricTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Minute
.
getName
());
}
@Override
public
int
refreshInterval
()
{
return
1
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuMonthMetricEsTableDefine.java
0 → 100644
浏览文件 @
8361f415
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.es.define.cpu
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable
;
/**
* @author peng-yongsheng
*/
public
class
CpuMonthMetricEsTableDefine
extends
AbstractCpuMetricEsTableDefine
{
public
CpuMonthMetricEsTableDefine
()
{
super
(
CpuMetricTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Month
.
getName
());
}
@Override
public
int
refreshInterval
()
{
return
1
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/apache/skywalking/apm/collector/storage/es/define/cpu/CpuSecondMetricEsTableDefine.java
0 → 100644
浏览文件 @
8361f415
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org.apache.skywalking.apm.collector.storage.es.define.cpu
;
import
org.apache.skywalking.apm.collector.core.storage.TimePyramid
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.table.jvm.CpuMetricTable
;
/**
* @author peng-yongsheng
*/
public
class
CpuSecondMetricEsTableDefine
extends
AbstractCpuMetricEsTableDefine
{
public
CpuSecondMetricEsTableDefine
()
{
super
(
CpuMetricTable
.
TABLE
+
Const
.
ID_SPLIT
+
TimePyramid
.
Second
.
getName
());
}
@Override
public
int
refreshInterval
()
{
return
1
;
}
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/resources/META-INF/defines/storage.define
浏览文件 @
8361f415
...
...
@@ -81,4 +81,10 @@ org.apache.skywalking.apm.collector.storage.es.define.gc.GCSecondMetricEsTableDe
org.apache.skywalking.apm.collector.storage.es.define.gc.GCMinuteMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCHourMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCDayMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.gc.GCMonthMetricEsTableDefine
\ No newline at end of file
org.apache.skywalking.apm.collector.storage.es.define.gc.GCMonthMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuSecondMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuMinuteMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuHourMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuDayMetricEsTableDefine
org.apache.skywalking.apm.collector.storage.es.define.cpu.CpuMonthMetricEsTableDefine
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录