Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
月轩居士
SkyWalking
提交
a17de070
S
SkyWalking
项目概览
月轩居士
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
4
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,发现更多精彩内容 >>
提交
a17de070
编写于
1月 01, 2018
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Application metric alarm.
上级
82771cc6
变更
22
显示空白变更内容
内联
并排
Showing
22 changed file
with
770 addition
and
38 deletion
+770
-38
apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java
...ector/analysis/alarm/define/graph/AlarmGraphIdDefine.java
+3
-4
apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java
...ctor/analysis/alarm/define/graph/AlarmWorkerIdDefine.java
+16
-17
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java
.../analysis/alarm/provider/AnalysisAlarmModuleProvider.java
+3
-3
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java
...orker/application/ApplicationMetricAlarmAssertWorker.java
+84
-0
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmGraph.java
...vider/worker/application/ApplicationMetricAlarmGraph.java
+21
-8
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmListPersistenceWorker.java
...lication/ApplicationMetricAlarmListPersistenceWorker.java
+66
-0
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java
.../application/ApplicationMetricAlarmPersistenceWorker.java
+66
-0
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java
...orker/application/ApplicationMetricAlarmRemoteWorker.java
+61
-0
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java
...pplication/ApplicationMetricAlarmToListNodeProcessor.java
+50
-0
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java
...rm/provider/worker/instance/InstanceMetricAlarmGraph.java
+2
-2
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java
...larm/provider/worker/service/ServiceMetricAlarmGraph.java
+2
-2
apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java
...king/apm/collector/configuration/ConfigurationModule.java
+2
-1
apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationAlarmRuleConfig.java
...or/configuration/service/IApplicationAlarmRuleConfig.java
+34
-0
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java
.../collector/configuration/ConfigurationModuleProvider.java
+3
-0
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationAlarmRuleConfig.java
...tor/configuration/service/ApplicationAlarmRuleConfig.java
+41
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationAlarmListPersistenceDAO.java
...ctor/storage/dao/IApplicationAlarmListPersistenceDAO.java
+28
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationAlarmPersistenceDAO.java
...ollector/storage/dao/IApplicationAlarmPersistenceDAO.java
+28
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarm.java
...g/apm/collector/storage/table/alarm/ApplicationAlarm.java
+103
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmList.java
...m/collector/storage/table/alarm/ApplicationAlarmList.java
+95
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmListTable.java
...lector/storage/table/alarm/ApplicationAlarmListTable.java
+30
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmTable.java
.../collector/storage/table/alarm/ApplicationAlarmTable.java
+31
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmListTable.java
.../collector/storage/table/alarm/ServiceAlarmListTable.java
+1
-1
未找到文件。
apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmGraphIdDefine.java
浏览文件 @
a17de070
...
...
@@ -22,8 +22,7 @@ package org.apache.skywalking.apm.collector.analysis.alarm.define.graph;
* @author peng-yongsheng
*/
public
class
AlarmGraphIdDefine
{
public
static
final
int
SERVICE_METRIC_TRANSFORM_GRAPH_ID
=
500
;
public
static
final
int
INSTANCE_METRIC_TRANSFORM_GRAPH_ID
=
501
;
public
static
final
int
APPLICATION_METRIC_TRANSFORM_GRAPH_ID
=
502
;
public
static
final
int
ALARM_METRIC_AGGREGATION_GRAPH_ID
=
503
;
public
static
final
int
SERVICE_METRIC_ALARM_GRAPH_ID
=
500
;
public
static
final
int
INSTANCE_METRIC_ALARM_GRAPH_ID
=
501
;
public
static
final
int
APPLICATION_METRIC_ALARM_GRAPH_ID
=
502
;
}
apm-collector/apm-collector-analysis/analysis-alarm/alarm-define/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/define/graph/AlarmWorkerIdDefine.java
浏览文件 @
a17de070
...
...
@@ -24,23 +24,22 @@ package org.apache.skywalking.apm.collector.analysis.alarm.define.graph;
public
class
AlarmWorkerIdDefine
{
public
static
final
int
SERVICE_METRIC_ALARM_ASSERT_WORKER_ID
=
500
;
public
static
final
int
SERVICE_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
501
;
public
static
final
int
SERVICE_METRIC_ALARM_REMOTE_WORKER_ID
=
50
0
;
public
static
final
int
SERVICE_METRIC_ALARM_PERSISTENCE_WORKER_ID
=
50
0
;
public
static
final
int
SERVICE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID
=
50
0
;
public
static
final
int
SERVICE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID
=
50
0
;
public
static
final
int
SERVICE_METRIC_ALARM_REMOTE_WORKER_ID
=
50
2
;
public
static
final
int
SERVICE_METRIC_ALARM_PERSISTENCE_WORKER_ID
=
50
3
;
public
static
final
int
SERVICE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID
=
50
4
;
public
static
final
int
SERVICE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID
=
50
5
;
public
static
final
int
INSTANCE_METRIC_ALARM_ASSERT_WORKER_ID
=
5
0
0
;
public
static
final
int
INSTANCE_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
5
0
1
;
public
static
final
int
INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID
=
5
00
;
public
static
final
int
INSTANCE_METRIC_ALARM_PERSISTENCE_WORKER_ID
=
5
00
;
public
static
final
int
INSTANCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID
=
5
00
;
public
static
final
int
INSTANCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID
=
5
00
;
public
static
final
int
INSTANCE_METRIC_ALARM_ASSERT_WORKER_ID
=
5
1
0
;
public
static
final
int
INSTANCE_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
5
1
1
;
public
static
final
int
INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID
=
5
12
;
public
static
final
int
INSTANCE_METRIC_ALARM_PERSISTENCE_WORKER_ID
=
5
13
;
public
static
final
int
INSTANCE_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID
=
5
14
;
public
static
final
int
INSTANCE_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID
=
5
15
;
public
static
final
int
APPLICATION_METRIC_TRANSFORM_WORKER_ID
=
504
;
public
static
final
int
APPLICATION_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
505
;
public
static
final
int
ALARM_METRIC_REMOTE_WORKER_ID
=
506
;
public
static
final
int
ALARM_METRIC_APPLICATION_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
507
;
public
static
final
int
ALARM_METRIC_INSTANCE_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
508
;
public
static
final
int
ALARM_METRIC_SERVICE_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
509
;
public
static
final
int
ALARM_METRIC_AGGREGATION_WORKER_ID
=
510
;
public
static
final
int
APPLICATION_METRIC_ALARM_ASSERT_WORKER_ID
=
520
;
public
static
final
int
APPLICATION_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
=
521
;
public
static
final
int
APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID
=
522
;
public
static
final
int
APPLICATION_METRIC_ALARM_PERSISTENCE_WORKER_ID
=
523
;
public
static
final
int
APPLICATION_METRIC_ALARM_LIST_PERSISTENCE_WORKER_ID
=
524
;
public
static
final
int
APPLICATION_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID
=
525
;
}
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/AnalysisAlarmModuleProvider.java
浏览文件 @
a17de070
...
...
@@ -20,7 +20,7 @@ package org.apache.skywalking.apm.collector.analysis.alarm.provider;
import
java.util.Properties
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.AnalysisAlarmModule
;
import
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.
ApplicationMetricTransfo
rmGraph
;
import
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.
application.ApplicationMetricAla
rmGraph
;
import
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.instance.InstanceMetricAlarmGraph
;
import
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.service.ServiceMetricAlarmGraph
;
import
org.apache.skywalking.apm.collector.analysis.metric.define.AnalysisMetricModule
;
...
...
@@ -58,8 +58,8 @@ public class AnalysisAlarmModuleProvider extends ModuleProvider {
InstanceMetricAlarmGraph
instanceMetricAlarmGraph
=
new
InstanceMetricAlarmGraph
(
getManager
(),
workerCreateListener
);
instanceMetricAlarmGraph
.
create
();
ApplicationMetric
TransformGraph
applicationMetricTransformGraph
=
new
ApplicationMetricTransfo
rmGraph
(
getManager
(),
workerCreateListener
);
applicationMetric
Transfo
rmGraph
.
create
();
ApplicationMetric
AlarmGraph
applicationMetricAlarmGraph
=
new
ApplicationMetricAla
rmGraph
(
getManager
(),
workerCreateListener
);
applicationMetric
Ala
rmGraph
.
create
();
}
...
...
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmAssertWorker.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.alarm.provider.worker.application
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorker
;
import
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker.AlarmAssertWorkerProvider
;
import
org.apache.skywalking.apm.collector.configuration.ConfigurationModule
;
import
org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetricAlarmAssertWorker
extends
AlarmAssertWorker
<
ApplicationMetric
,
ApplicationAlarm
>
{
private
final
IApplicationAlarmRuleConfig
applicationAlarmRuleConfig
;
public
ApplicationMetricAlarmAssertWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
this
.
applicationAlarmRuleConfig
=
moduleManager
.
find
(
ConfigurationModule
.
NAME
).
getService
(
IApplicationAlarmRuleConfig
.
class
);
}
@Override
public
int
id
()
{
return
AlarmWorkerIdDefine
.
APPLICATION_METRIC_ALARM_ASSERT_WORKER_ID
;
}
@Override
protected
ApplicationAlarm
newAlarmObject
(
String
id
,
ApplicationMetric
inputMetric
)
{
ApplicationAlarm
applicationAlarm
=
new
ApplicationAlarm
(
id
+
Const
.
ID_SPLIT
+
inputMetric
.
getApplicationId
());
applicationAlarm
.
setApplicationId
(
inputMetric
.
getApplicationId
());
return
applicationAlarm
;
}
@Override
protected
Double
calleeErrorRateThreshold
()
{
return
applicationAlarmRuleConfig
.
calleeErrorRateThreshold
();
}
@Override
protected
Double
callerErrorRateThreshold
()
{
return
applicationAlarmRuleConfig
.
callerErrorRateThreshold
();
}
@Override
protected
Double
calleeAverageResponseTimeThreshold
()
{
return
applicationAlarmRuleConfig
.
calleeAverageResponseTimeThreshold
();
}
@Override
protected
Double
callerAverageResponseTimeThreshold
()
{
return
applicationAlarmRuleConfig
.
callerAverageResponseTimeThreshold
();
}
public
static
class
Factory
extends
AlarmAssertWorkerProvider
<
ApplicationMetric
,
ApplicationAlarm
,
ApplicationMetricAlarmAssertWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMetricAlarmAssertWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMetricAlarmAssertWorker
(
moduleManager
);
}
@Override
public
int
queueSize
()
{
return
1024
;
}
}
}
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/
ApplicationMetricTransfo
rmGraph.java
→
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/
application/ApplicationMetricAla
rmGraph.java
浏览文件 @
a17de070
...
...
@@ -16,7 +16,7 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker
;
package
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker
.application
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmGraphIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine
;
...
...
@@ -28,38 +28,51 @@ import org.apache.skywalking.apm.collector.core.graph.GraphManager;
import
org.apache.skywalking.apm.collector.core.graph.Next
;
import
org.apache.skywalking.apm.collector.core.graph.NodeProcessor
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.RemoteModule
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetric
Transfo
rmGraph
{
public
class
ApplicationMetric
Ala
rmGraph
{
private
final
ModuleManager
moduleManager
;
private
final
WorkerCreateListener
workerCreateListener
;
public
ApplicationMetric
Transfo
rmGraph
(
ModuleManager
moduleManager
,
WorkerCreateListener
workerCreateListener
)
{
public
ApplicationMetric
Ala
rmGraph
(
ModuleManager
moduleManager
,
WorkerCreateListener
workerCreateListener
)
{
this
.
moduleManager
=
moduleManager
;
this
.
workerCreateListener
=
workerCreateListener
;
}
public
void
create
()
{
Graph
<
ApplicationMetric
>
graph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
AlarmGraphIdDefine
.
APPLICATION_METRIC_TRANSFORM_GRAPH_ID
,
ApplicationMetric
.
class
);
graph
.
addNode
(
new
ApplicationMetricTransformWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
RemoteSenderService
remoteSenderService
=
moduleManager
.
find
(
RemoteModule
.
NAME
).
getService
(
RemoteSenderService
.
class
);
Graph
<
ApplicationMetric
>
graph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
AlarmGraphIdDefine
.
APPLICATION_METRIC_ALARM_GRAPH_ID
,
ApplicationMetric
.
class
);
graph
.
addNode
(
new
ApplicationMetricAlarmAssertWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
))
.
addNext
(
new
ApplicationMetricAlarmRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
AlarmGraphIdDefine
.
APPLICATION_METRIC_ALARM_GRAPH_ID
).
create
(
workerCreateListener
))
.
addNext
(
new
ApplicationMetricAlarmPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
graph
.
toFinder
().
findNode
(
AlarmWorkerIdDefine
.
APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID
,
ApplicationAlarm
.
class
)
.
addNext
(
new
ApplicationMetricAlarmToListNodeProcessor
())
.
addNext
(
new
ApplicationMetricAlarmListPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
link
(
graph
);
}
private
void
link
(
Graph
<
ApplicationMetric
>
graph
)
{
GraphManager
.
INSTANCE
.
findGraph
(
MetricGraphIdDefine
.
APPLICATION_METRIC_GRAPH_ID
,
ApplicationMetric
.
class
)
.
toFinder
().
findNode
(
MetricWorkerIdDefine
.
APPLICATION_M
APPING_AGGREGATION
_WORKER_ID
,
ApplicationMetric
.
class
)
.
toFinder
().
findNode
(
MetricWorkerIdDefine
.
APPLICATION_M
ETRIC_PERSISTENCE
_WORKER_ID
,
ApplicationMetric
.
class
)
.
addNext
(
new
NodeProcessor
<
ApplicationMetric
,
ApplicationMetric
>()
{
@Override
public
int
id
()
{
return
AlarmWorkerIdDefine
.
APPLICATION_METRIC_TRANSFORM_GRAPH_BRIDGE_WORKER_ID
;
}
@Override
public
void
process
(
ApplicationMetric
application
Metric
,
@Override
public
void
process
(
ApplicationMetric
instance
Metric
,
Next
<
ApplicationMetric
>
next
)
{
graph
.
start
(
application
Metric
);
graph
.
start
(
instance
Metric
);
}
});
}
...
...
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/
ApplicationMetricTransform
Worker.java
→
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/
application/ApplicationMetricAlarmListPersistence
Worker.java
浏览文件 @
a17de070
...
...
@@ -16,63 +16,46 @@
*
*/
package
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker
;
package
org.apache.skywalking.apm.collector.analysis.alarm.provider.worker
.application
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.
base.AbstractLocalAsyncWorkerProvid
er
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.
AggregationWork
er
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.
impl.PersistenceWork
er
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.
PersistenceWorkerProvid
er
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.AlarmMetric
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.Layer
;
import
org.apache.skywalking.apm.collector.storage.table.application.ApplicationMetric
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationAlarmListPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetric
TransformWorker
extends
AggregationWorker
<
ApplicationMetric
,
AlarmMetric
>
{
public
class
ApplicationMetric
AlarmListPersistenceWorker
extends
PersistenceWorker
<
ApplicationAlarmList
>
{
public
ApplicationMetric
Transform
Worker
(
ModuleManager
moduleManager
)
{
public
ApplicationMetric
AlarmListPersistence
Worker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
AlarmWorkerIdDefine
.
APPLICATION_METRIC_
TRANSFORM
_WORKER_ID
;
return
AlarmWorkerIdDefine
.
APPLICATION_METRIC_
ALARM_LIST_PERSISTENCE
_WORKER_ID
;
}
@Override
protected
AlarmMetric
transform
(
ApplicationMetric
applicationMetric
)
{
AlarmMetric
alarmMetric
=
new
AlarmMetric
(
String
.
valueOf
(
applicationMetric
.
getApplicationId
()));
alarmMetric
.
setLayer
(
Layer
.
APPLICATION
.
getValue
());
alarmMetric
.
setObjectId
(
applicationMetric
.
getApplicationId
());
alarmMetric
.
setApplicationId
(
applicationMetric
.
getApplicationId
());
alarmMetric
.
setSourceValue
(
applicationMetric
.
getSourceValue
());
alarmMetric
.
setTransactionCalls
(
applicationMetric
.
getTransactionCalls
());
alarmMetric
.
setTransactionDurationSum
(
applicationMetric
.
getTransactionDurationSum
());
alarmMetric
.
setTransactionErrorCalls
(
applicationMetric
.
getTransactionErrorCalls
());
alarmMetric
.
setTransactionErrorDurationSum
(
applicationMetric
.
getTransactionErrorDurationSum
());
alarmMetric
.
setBusinessTransactionCalls
(
applicationMetric
.
getBusinessTransactionCalls
());
alarmMetric
.
setBusinessTransactionDurationSum
(
applicationMetric
.
getBusinessTransactionDurationSum
());
alarmMetric
.
setBusinessTransactionErrorCalls
(
applicationMetric
.
getBusinessTransactionErrorCalls
());
alarmMetric
.
setBusinessTransactionErrorDurationSum
(
applicationMetric
.
getBusinessTransactionErrorDurationSum
());
alarmMetric
.
setMqTransactionCalls
(
applicationMetric
.
getMqTransactionCalls
());
alarmMetric
.
setMqTransactionDurationSum
(
applicationMetric
.
getMqTransactionDurationSum
());
alarmMetric
.
setMqTransactionErrorCalls
(
applicationMetric
.
getMqTransactionErrorCalls
());
alarmMetric
.
setMqTransactionErrorDurationSum
(
applicationMetric
.
getMqTransactionErrorDurationSum
());
alarmMetric
.
setTimeBucket
(
applicationMetric
.
getTimeBucket
());
return
alarmMetric
;
@Override
protected
boolean
needMergeDBData
()
{
return
true
;
}
public
static
class
Factory
extends
AbstractLocalAsyncWorkerProvider
<
ApplicationMetric
,
AlarmMetric
,
ApplicationMetricTransformWorker
>
{
@SuppressWarnings
(
"unchecked"
)
@Override
protected
IPersistenceDAO
<?,
?,
ApplicationAlarmList
>
persistenceDAO
()
{
return
getModuleManager
().
find
(
StorageModule
.
NAME
).
getService
(
IApplicationAlarmListPersistenceDAO
.
class
);
}
public
static
class
Factory
extends
PersistenceWorkerProvider
<
ApplicationAlarmList
,
ApplicationMetricAlarmListPersistenceWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMetric
Transform
Worker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMetric
Transform
Worker
(
moduleManager
);
@Override
public
ApplicationMetric
AlarmListPersistence
Worker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMetric
AlarmListPersistence
Worker
(
moduleManager
);
}
@Override
...
...
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmPersistenceWorker.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.alarm.provider.worker.application
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.impl.PersistenceWorkerProvider
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.storage.StorageModule
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.dao.IApplicationAlarmPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetricAlarmPersistenceWorker
extends
PersistenceWorker
<
ApplicationAlarm
>
{
public
ApplicationMetricAlarmPersistenceWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
AlarmWorkerIdDefine
.
APPLICATION_METRIC_ALARM_PERSISTENCE_WORKER_ID
;
}
@Override
protected
boolean
needMergeDBData
()
{
return
true
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
protected
IPersistenceDAO
<?,
?,
ApplicationAlarm
>
persistenceDAO
()
{
return
getModuleManager
().
find
(
StorageModule
.
NAME
).
getService
(
IApplicationAlarmPersistenceDAO
.
class
);
}
public
static
class
Factory
extends
PersistenceWorkerProvider
<
ApplicationAlarm
,
ApplicationMetricAlarmPersistenceWorker
>
{
public
Factory
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
ApplicationMetricAlarmPersistenceWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMetricAlarmPersistenceWorker
(
moduleManager
);
}
@Override
public
int
queueSize
()
{
return
1024
;
}
}
}
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmRemoteWorker.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.alarm.provider.worker.application
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorker
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.AbstractRemoteWorkerProvider
;
import
org.apache.skywalking.apm.collector.analysis.worker.model.base.WorkerException
;
import
org.apache.skywalking.apm.collector.core.module.ModuleManager
;
import
org.apache.skywalking.apm.collector.remote.service.RemoteSenderService
;
import
org.apache.skywalking.apm.collector.remote.service.Selector
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetricAlarmRemoteWorker
extends
AbstractRemoteWorker
<
ApplicationAlarm
,
ApplicationAlarm
>
{
public
ApplicationMetricAlarmRemoteWorker
(
ModuleManager
moduleManager
)
{
super
(
moduleManager
);
}
@Override
public
int
id
()
{
return
AlarmWorkerIdDefine
.
APPLICATION_METRIC_ALARM_REMOTE_WORKER_ID
;
}
@Override
public
Selector
selector
()
{
return
Selector
.
HashCode
;
}
@Override
protected
void
onWork
(
ApplicationAlarm
message
)
throws
WorkerException
{
onNext
(
message
);
}
public
static
class
Factory
extends
AbstractRemoteWorkerProvider
<
ApplicationAlarm
,
ApplicationAlarm
,
ApplicationMetricAlarmRemoteWorker
>
{
public
Factory
(
ModuleManager
moduleManager
,
RemoteSenderService
remoteSenderService
,
int
graphId
)
{
super
(
moduleManager
,
remoteSenderService
,
graphId
);
}
@Override
public
ApplicationMetricAlarmRemoteWorker
workerInstance
(
ModuleManager
moduleManager
)
{
return
new
ApplicationMetricAlarmRemoteWorker
(
moduleManager
);
}
}
}
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/application/ApplicationMetricAlarmToListNodeProcessor.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.alarm.provider.worker.application
;
import
org.apache.skywalking.apm.collector.analysis.alarm.define.graph.AlarmWorkerIdDefine
;
import
org.apache.skywalking.apm.collector.core.graph.Next
;
import
org.apache.skywalking.apm.collector.core.graph.NodeProcessor
;
import
org.apache.skywalking.apm.collector.core.util.Const
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationMetricAlarmToListNodeProcessor
implements
NodeProcessor
<
ApplicationAlarm
,
ApplicationAlarmList
>
{
@Override
public
int
id
()
{
return
AlarmWorkerIdDefine
.
APPLICATION_METRIC_ALARM_TO_LIST_NODE_PROCESSOR_ID
;
}
@Override
public
void
process
(
ApplicationAlarm
applicationAlarm
,
Next
<
ApplicationAlarmList
>
next
)
{
String
id
=
applicationAlarm
.
getLastTimeBucket
()
+
Const
.
ID_SPLIT
+
applicationAlarm
.
getSourceValue
()
+
Const
.
ID_SPLIT
+
applicationAlarm
.
getAlarmType
()
+
Const
.
ID_SPLIT
+
applicationAlarm
.
getApplicationId
();
ApplicationAlarmList
applicationAlarmList
=
new
ApplicationAlarmList
(
id
);
applicationAlarmList
.
setApplicationId
(
applicationAlarm
.
getApplicationId
());
applicationAlarmList
.
setSourceValue
(
applicationAlarm
.
getSourceValue
());
applicationAlarmList
.
setAlarmType
(
applicationAlarm
.
getAlarmType
());
applicationAlarmList
.
setTimeBucket
(
applicationAlarm
.
getLastTimeBucket
());
applicationAlarmList
.
setAlarmContent
(
applicationAlarm
.
getAlarmContent
());
next
.
execute
(
applicationAlarmList
);
}
}
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/instance/InstanceMetricAlarmGraph.java
浏览文件 @
a17de070
...
...
@@ -49,10 +49,10 @@ public class InstanceMetricAlarmGraph {
public
void
create
()
{
RemoteSenderService
remoteSenderService
=
moduleManager
.
find
(
RemoteModule
.
NAME
).
getService
(
RemoteSenderService
.
class
);
Graph
<
InstanceMetric
>
graph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
AlarmGraphIdDefine
.
INSTANCE_METRIC_
TRANSFO
RM_GRAPH_ID
,
InstanceMetric
.
class
);
Graph
<
InstanceMetric
>
graph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
AlarmGraphIdDefine
.
INSTANCE_METRIC_
ALA
RM_GRAPH_ID
,
InstanceMetric
.
class
);
graph
.
addNode
(
new
InstanceMetricAlarmAssertWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
))
.
addNext
(
new
InstanceMetricAlarmRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
AlarmGraphIdDefine
.
INSTANCE_METRIC_
TRANSFO
RM_GRAPH_ID
).
create
(
workerCreateListener
))
.
addNext
(
new
InstanceMetricAlarmRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
AlarmGraphIdDefine
.
INSTANCE_METRIC_
ALA
RM_GRAPH_ID
).
create
(
workerCreateListener
))
.
addNext
(
new
InstanceMetricAlarmPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
graph
.
toFinder
().
findNode
(
AlarmWorkerIdDefine
.
INSTANCE_METRIC_ALARM_REMOTE_WORKER_ID
,
InstanceAlarm
.
class
)
...
...
apm-collector/apm-collector-analysis/analysis-alarm/alarm-provider/src/main/java/org/apache/skywalking/apm/collector/analysis/alarm/provider/worker/service/ServiceMetricAlarmGraph.java
浏览文件 @
a17de070
...
...
@@ -49,10 +49,10 @@ public class ServiceMetricAlarmGraph {
public
void
create
()
{
RemoteSenderService
remoteSenderService
=
moduleManager
.
find
(
RemoteModule
.
NAME
).
getService
(
RemoteSenderService
.
class
);
Graph
<
ServiceMetric
>
graph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
AlarmGraphIdDefine
.
SERVICE_METRIC_
TRANSFO
RM_GRAPH_ID
,
ServiceMetric
.
class
);
Graph
<
ServiceMetric
>
graph
=
GraphManager
.
INSTANCE
.
createIfAbsent
(
AlarmGraphIdDefine
.
SERVICE_METRIC_
ALA
RM_GRAPH_ID
,
ServiceMetric
.
class
);
graph
.
addNode
(
new
ServiceMetricAlarmAssertWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
))
.
addNext
(
new
ServiceMetricAlarmRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
AlarmGraphIdDefine
.
SERVICE_METRIC_
TRANSFO
RM_GRAPH_ID
).
create
(
workerCreateListener
))
.
addNext
(
new
ServiceMetricAlarmRemoteWorker
.
Factory
(
moduleManager
,
remoteSenderService
,
AlarmGraphIdDefine
.
SERVICE_METRIC_
ALA
RM_GRAPH_ID
).
create
(
workerCreateListener
))
.
addNext
(
new
ServiceMetricAlarmPersistenceWorker
.
Factory
(
moduleManager
).
create
(
workerCreateListener
));
graph
.
toFinder
().
findNode
(
AlarmWorkerIdDefine
.
SERVICE_METRIC_ALARM_REMOTE_WORKER_ID
,
ServiceAlarm
.
class
)
...
...
apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModule.java
浏览文件 @
a17de070
...
...
@@ -19,6 +19,7 @@
package
org.apache.skywalking.apm.collector.configuration
;
import
org.apache.skywalking.apm.collector.configuration.service.IApdexThresholdService
;
import
org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.configuration.service.IInstanceAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.configuration.service.IServiceAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.core.module.Module
;
...
...
@@ -35,6 +36,6 @@ public class ConfigurationModule extends Module {
}
@Override
public
Class
[]
services
()
{
return
new
Class
[]
{
IApdexThresholdService
.
class
,
IServiceAlarmRuleConfig
.
class
,
IInstanceAlarmRuleConfig
.
class
};
return
new
Class
[]
{
IApdexThresholdService
.
class
,
IServiceAlarmRuleConfig
.
class
,
IInstanceAlarmRuleConfig
.
class
,
IApplicationAlarmRuleConfig
.
class
};
}
}
apm-collector/apm-collector-configuration/collector-configuration-define/src/main/java/org/apache/skywalking/apm/collector/configuration/service/IApplicationAlarmRuleConfig.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.configuration.service
;
import
org.apache.skywalking.apm.collector.core.module.Service
;
/**
* @author peng-yongsheng
*/
public
interface
IApplicationAlarmRuleConfig
extends
Service
{
double
calleeErrorRateThreshold
();
double
calleeAverageResponseTimeThreshold
();
double
callerErrorRateThreshold
();
double
callerAverageResponseTimeThreshold
();
}
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/ConfigurationModuleProvider.java
浏览文件 @
a17de070
...
...
@@ -20,7 +20,9 @@ package org.apache.skywalking.apm.collector.configuration;
import
java.util.Properties
;
import
org.apache.skywalking.apm.collector.configuration.service.ApdexThresholdService
;
import
org.apache.skywalking.apm.collector.configuration.service.ApplicationAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.configuration.service.IApdexThresholdService
;
import
org.apache.skywalking.apm.collector.configuration.service.IApplicationAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.configuration.service.IInstanceAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.configuration.service.IServiceAlarmRuleConfig
;
import
org.apache.skywalking.apm.collector.configuration.service.InstanceAlarmRuleConfig
;
...
...
@@ -46,6 +48,7 @@ public class ConfigurationModuleProvider extends ModuleProvider {
this
.
registerServiceImplementation
(
IApdexThresholdService
.
class
,
new
ApdexThresholdService
());
this
.
registerServiceImplementation
(
IServiceAlarmRuleConfig
.
class
,
new
ServiceAlarmRuleConfig
());
this
.
registerServiceImplementation
(
IInstanceAlarmRuleConfig
.
class
,
new
InstanceAlarmRuleConfig
());
this
.
registerServiceImplementation
(
IApplicationAlarmRuleConfig
.
class
,
new
ApplicationAlarmRuleConfig
());
}
@Override
public
void
start
(
Properties
config
)
throws
ServiceNotProvidedException
{
...
...
apm-collector/apm-collector-configuration/collector-configuration-provider/src/main/java/org/apache/skywalking/apm/collector/configuration/service/ApplicationAlarmRuleConfig.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.configuration.service
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationAlarmRuleConfig
implements
IApplicationAlarmRuleConfig
{
@Override
public
double
calleeErrorRateThreshold
()
{
return
10.00
;
}
@Override
public
double
calleeAverageResponseTimeThreshold
()
{
return
2000
;
}
@Override
public
double
callerErrorRateThreshold
()
{
return
10.00
;
}
@Override
public
double
callerAverageResponseTimeThreshold
()
{
return
3000
;
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationAlarmListPersistenceDAO.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.dao
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarmList
;
/**
* @author peng-yongsheng
*/
public
interface
IApplicationAlarmListPersistenceDAO
<
Insert
,
Update
,
DataImpl
extends
ApplicationAlarmList
>
extends
IPersistenceDAO
<
Insert
,
Update
,
DataImpl
>
{
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/dao/IApplicationAlarmPersistenceDAO.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.dao
;
import
org.apache.skywalking.apm.collector.storage.base.dao.IPersistenceDAO
;
import
org.apache.skywalking.apm.collector.storage.table.alarm.ApplicationAlarm
;
/**
* @author peng-yongsheng
*/
public
interface
IApplicationAlarmPersistenceDAO
<
Insert
,
Update
,
DataImpl
extends
ApplicationAlarm
>
extends
IPersistenceDAO
<
Insert
,
Update
,
DataImpl
>
{
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarm.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.table.alarm
;
import
org.apache.skywalking.apm.collector.core.data.Column
;
import
org.apache.skywalking.apm.collector.core.data.Data
;
import
org.apache.skywalking.apm.collector.core.data.operator.CoverOperation
;
import
org.apache.skywalking.apm.collector.core.data.operator.NonOperation
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationAlarm
extends
Data
implements
Alarm
{
private
static
final
Column
[]
STRING_COLUMNS
=
{
new
Column
(
ApplicationAlarmTable
.
COLUMN_ID
,
new
NonOperation
()),
new
Column
(
ApplicationAlarmTable
.
COLUMN_ALARM_CONTENT
,
new
CoverOperation
()),
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
new
Column
(
ApplicationAlarmTable
.
COLUMN_LAST_TIME_BUCKET
,
new
CoverOperation
()),
};
private
static
final
Column
[]
DOUBLE_COLUMNS
=
{};
private
static
final
Column
[]
INTEGER_COLUMNS
=
{
new
Column
(
ApplicationAlarmTable
.
COLUMN_ALARM_TYPE
,
new
NonOperation
()),
new
Column
(
ApplicationAlarmTable
.
COLUMN_SOURCE_VALUE
,
new
NonOperation
()),
new
Column
(
ApplicationAlarmTable
.
COLUMN_APPLICATION_ID
,
new
NonOperation
()),
};
private
static
final
Column
[]
BOOLEAN_COLUMNS
=
{};
private
static
final
Column
[]
BYTE_COLUMNS
=
{};
public
ApplicationAlarm
(
String
id
)
{
super
(
id
,
STRING_COLUMNS
,
LONG_COLUMNS
,
DOUBLE_COLUMNS
,
INTEGER_COLUMNS
,
BOOLEAN_COLUMNS
,
BYTE_COLUMNS
);
}
@Override
public
Integer
getAlarmType
()
{
return
getDataInteger
(
0
);
}
@Override
public
void
setAlarmType
(
Integer
alarmType
)
{
setDataInteger
(
0
,
alarmType
);
}
@Override
public
Integer
getSourceValue
()
{
return
getDataInteger
(
1
);
}
@Override
public
void
setSourceValue
(
Integer
sourceValue
)
{
setDataInteger
(
1
,
sourceValue
);
}
public
Integer
getApplicationId
()
{
return
getDataInteger
(
2
);
}
public
void
setApplicationId
(
Integer
applicationId
)
{
setDataInteger
(
2
,
applicationId
);
}
@Override
public
Long
getLastTimeBucket
()
{
return
getDataLong
(
0
);
}
@Override
public
void
setLastTimeBucket
(
Long
lastTimeBucket
)
{
setDataLong
(
0
,
lastTimeBucket
);
}
@Override
public
String
getAlarmContent
()
{
return
getDataString
(
1
);
}
@Override
public
void
setAlarmContent
(
String
alarmContent
)
{
setDataString
(
1
,
alarmContent
);
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmList.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.table.alarm
;
import
org.apache.skywalking.apm.collector.core.data.Column
;
import
org.apache.skywalking.apm.collector.core.data.Data
;
import
org.apache.skywalking.apm.collector.core.data.operator.CoverOperation
;
import
org.apache.skywalking.apm.collector.core.data.operator.NonOperation
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationAlarmList
extends
Data
{
private
static
final
Column
[]
STRING_COLUMNS
=
{
new
Column
(
ApplicationAlarmListTable
.
COLUMN_ID
,
new
NonOperation
()),
new
Column
(
ApplicationAlarmListTable
.
COLUMN_ALARM_CONTENT
,
new
CoverOperation
()),
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
new
Column
(
ApplicationAlarmListTable
.
COLUMN_TIME_BUCKET
,
new
NonOperation
()),
};
private
static
final
Column
[]
DOUBLE_COLUMNS
=
{};
private
static
final
Column
[]
INTEGER_COLUMNS
=
{
new
Column
(
ApplicationAlarmListTable
.
COLUMN_ALARM_TYPE
,
new
NonOperation
()),
new
Column
(
ApplicationAlarmListTable
.
COLUMN_SOURCE_VALUE
,
new
NonOperation
()),
new
Column
(
ApplicationAlarmListTable
.
COLUMN_APPLICATION_ID
,
new
NonOperation
()),
};
private
static
final
Column
[]
BOOLEAN_COLUMNS
=
{};
private
static
final
Column
[]
BYTE_COLUMNS
=
{};
public
ApplicationAlarmList
(
String
id
)
{
super
(
id
,
STRING_COLUMNS
,
LONG_COLUMNS
,
DOUBLE_COLUMNS
,
INTEGER_COLUMNS
,
BOOLEAN_COLUMNS
,
BYTE_COLUMNS
);
}
public
Integer
getAlarmType
()
{
return
getDataInteger
(
0
);
}
public
void
setAlarmType
(
Integer
alarmType
)
{
setDataInteger
(
0
,
alarmType
);
}
public
Integer
getSourceValue
()
{
return
getDataInteger
(
1
);
}
public
void
setSourceValue
(
Integer
sourceValue
)
{
setDataInteger
(
1
,
sourceValue
);
}
public
Integer
getApplicationId
()
{
return
getDataInteger
(
2
);
}
public
void
setApplicationId
(
Integer
applicationId
)
{
setDataInteger
(
2
,
applicationId
);
}
public
Long
getTimeBucket
()
{
return
getDataLong
(
0
);
}
public
void
setTimeBucket
(
Long
timeBucket
)
{
setDataLong
(
0
,
timeBucket
);
}
public
String
getAlarmContent
()
{
return
getDataString
(
1
);
}
public
void
setAlarmContent
(
String
alarmContent
)
{
setDataString
(
1
,
alarmContent
);
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmListTable.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.table.alarm
;
import
org.apache.skywalking.apm.collector.storage.table.CommonMetricTable
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationAlarmListTable
extends
CommonMetricTable
{
public
static
final
String
TABLE
=
"application_alarm_list"
;
public
static
final
String
COLUMN_ALARM_TYPE
=
"alarm_type"
;
public
static
final
String
COLUMN_ALARM_CONTENT
=
"alarm_content"
;
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ApplicationAlarmTable.java
0 → 100644
浏览文件 @
a17de070
/*
* 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.table.alarm
;
import
org.apache.skywalking.apm.collector.storage.table.CommonMetricTable
;
/**
* @author peng-yongsheng
*/
public
class
ApplicationAlarmTable
extends
CommonMetricTable
{
public
static
final
String
TABLE
=
"application_alarm"
;
public
static
final
String
COLUMN_ALARM_TYPE
=
"alarm_type"
;
public
static
final
String
COLUMN_LAST_TIME_BUCKET
=
"last_time_bucket"
;
public
static
final
String
COLUMN_ALARM_CONTENT
=
"alarm_content"
;
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/apache/skywalking/apm/collector/storage/table/alarm/ServiceAlarmListTable.java
浏览文件 @
a17de070
...
...
@@ -24,7 +24,7 @@ import org.apache.skywalking.apm.collector.storage.table.CommonMetricTable;
* @author peng-yongsheng
*/
public
class
ServiceAlarmListTable
extends
CommonMetricTable
{
public
static
final
String
TABLE
=
"service_alarm"
;
public
static
final
String
TABLE
=
"service_alarm
_list
"
;
public
static
final
String
COLUMN_ALARM_TYPE
=
"alarm_type"
;
public
static
final
String
COLUMN_ALARM_CONTENT
=
"alarm_content"
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录