Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
SkyWalking
提交
e64e2c3f
S
SkyWalking
项目概览
apache
/
SkyWalking
上一次同步 1 年多
通知
302
Star
21345
Fork
6091
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
e64e2c3f
编写于
12月 02, 2017
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make service metric contains transaction, business transaction, mq transaction.
上级
6d027a72
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
307 addition
and
116 deletion
+307
-116
apm-collector/apm-collector-agent-stream/collector-agent-stream-provider/src/main/java/org/skywalking/apm/collector/agent/stream/worker/trace/service/ServiceMetricAggregationWorker.java
.../worker/trace/service/ServiceMetricAggregationWorker.java
+4
-4
apm-collector/apm-collector-agent-stream/collector-agent-stream-provider/src/main/java/org/skywalking/apm/collector/agent/stream/worker/trace/service/ServiceReferenceMetricSpanListener.java
...ker/trace/service/ServiceReferenceMetricSpanListener.java
+4
-4
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/data/CommonTable.java
...a/org/skywalking/apm/collector/core/data/CommonTable.java
+1
-1
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/CommonMetricTable.java
...alking/apm/collector/storage/table/CommonMetricTable.java
+39
-0
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceMetric.java
...ng/apm/collector/storage/table/service/ServiceMetric.java
+93
-21
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceMetricTable.java
...m/collector/storage/table/service/ServiceMetricTable.java
+2
-6
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceReferenceMetric.java
...llector/storage/table/service/ServiceReferenceMetric.java
+34
-34
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceReferenceMetricTable.java
...or/storage/table/service/ServiceReferenceMetricTable.java
+2
-14
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/ServiceMetricEsPersistenceDAO.java
...llector/storage/es/dao/ServiceMetricEsPersistenceDAO.java
+48
-12
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/ServiceMetricEsTableDefine.java
...llector/storage/es/define/ServiceMetricEsTableDefine.java
+16
-4
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/ServiceMetricH2PersistenceDAO.java
...llector/storage/h2/dao/ServiceMetricH2PersistenceDAO.java
+48
-12
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/ServiceMetricH2TableDefine.java
...llector/storage/h2/define/ServiceMetricH2TableDefine.java
+16
-4
未找到文件。
apm-collector/apm-collector-agent-stream/collector-agent-stream-provider/src/main/java/org/skywalking/apm/collector/agent/stream/worker/trace/service/ServiceMetricAggregationWorker.java
浏览文件 @
e64e2c3f
...
...
@@ -44,10 +44,10 @@ public class ServiceMetricAggregationWorker extends AggregationWorker<ServiceRef
Long
timeBucket
=
serviceReferenceMetric
.
getTimeBucket
();
ServiceMetric
serviceMetric
=
new
ServiceMetric
(
String
.
valueOf
(
timeBucket
)
+
Const
.
ID_SPLIT
+
String
.
valueOf
(
serviceId
));
serviceMetric
.
setServiceId
(
serviceId
);
serviceMetric
.
setCalls
(
serviceReferenceMetric
.
getCalls
());
serviceMetric
.
setErrorCalls
(
serviceReferenceMetric
.
getErrorCalls
());
serviceMetric
.
setDurationSum
(
serviceReferenceMetric
.
getDurationSum
());
serviceMetric
.
setErrorDurationSum
(
serviceReferenceMetric
.
getErrorDurationSum
());
//
serviceMetric.setCalls(serviceReferenceMetric.getCalls());
//
serviceMetric.setErrorCalls(serviceReferenceMetric.getErrorCalls());
//
serviceMetric.setDurationSum(serviceReferenceMetric.getDurationSum());
//
serviceMetric.setErrorDurationSum(serviceReferenceMetric.getErrorDurationSum());
serviceMetric
.
setTimeBucket
(
timeBucket
);
return
serviceMetric
;
...
...
apm-collector/apm-collector-agent-stream/collector-agent-stream-provider/src/main/java/org/skywalking/apm/collector/agent/stream/worker/trace/service/ServiceReferenceMetricSpanListener.java
浏览文件 @
e64e2c3f
...
...
@@ -74,12 +74,12 @@ public class ServiceReferenceMetricSpanListener implements FirstSpanListener, En
long
endTime
,
boolean
isError
)
{
long
duration
=
endTime
-
startTime
;
serviceReferenceMetric
.
setCalls
(
1L
);
serviceReferenceMetric
.
setDurationSum
(
duration
);
serviceReferenceMetric
.
set
Transaction
Calls
(
1L
);
serviceReferenceMetric
.
set
Transaction
DurationSum
(
duration
);
if
(
isError
)
{
serviceReferenceMetric
.
setErrorCalls
(
1L
);
serviceReferenceMetric
.
setErrorDurationSum
(
duration
);
serviceReferenceMetric
.
set
Transaction
ErrorCalls
(
1L
);
serviceReferenceMetric
.
set
Transaction
ErrorDurationSum
(
duration
);
}
}
...
...
apm-collector/apm-collector-core/src/main/java/org/skywalking/apm/collector/core/data/CommonTable.java
浏览文件 @
e64e2c3f
...
...
@@ -21,7 +21,7 @@ package org.skywalking.apm.collector.core.data;
/**
* @author peng-yongsheng
*/
public
class
CommonTable
{
public
abstract
class
CommonTable
{
public
static
final
String
TABLE_TYPE
=
"type"
;
public
static
final
String
COLUMN_ID
=
"id"
;
public
static
final
String
COLUMN_AGG
=
"agg"
;
...
...
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/CommonMetricTable.java
0 → 100644
浏览文件 @
e64e2c3f
/*
* Copyright 2017, OpenSkywalking Organization All rights reserved.
*
* Licensed 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.
*
* Project repository: https://github.com/OpenSkywalking/skywalking
*/
package
org.skywalking.apm.collector.storage.table
;
import
org.skywalking.apm.collector.core.data.CommonTable
;
/**
* @author peng-yongsheng
*/
public
abstract
class
CommonMetricTable
extends
CommonTable
{
public
static
final
String
COLUMN_TRANSACTION_CALLS
=
"transaction_calls"
;
public
static
final
String
COLUMN_TRANSACTION_ERROR_CALLS
=
"transaction_error_calls"
;
public
static
final
String
COLUMN_TRANSACTION_DURATION_SUM
=
"transaction_duration_sum"
;
public
static
final
String
COLUMN_TRANSACTION_ERROR_DURATION_SUM
=
"transaction_error_duration_sum"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_CALLS
=
"business_transaction_calls"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
=
"business_transaction_error_calls"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
=
"business_transaction_duration_sum"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
=
"business_transaction_error_duration_sum"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_CALLS
=
"mq_transaction_calls"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_ERROR_CALLS
=
"mq_transaction_error_calls"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_DURATION_SUM
=
"mq_transaction_duration_sum"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
=
"mq_transaction_error_duration_sum"
;
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceMetric.java
浏览文件 @
e64e2c3f
...
...
@@ -21,7 +21,6 @@ package org.skywalking.apm.collector.storage.table.service;
import
org.skywalking.apm.collector.core.data.Column
;
import
org.skywalking.apm.collector.core.data.Data
;
import
org.skywalking.apm.collector.core.data.operator.AddOperation
;
import
org.skywalking.apm.collector.core.data.operator.CoverOperation
;
import
org.skywalking.apm.collector.core.data.operator.NonOperation
;
/**
...
...
@@ -34,11 +33,20 @@ public class ServiceMetric extends Data {
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
new
Column
(
ServiceMetricTable
.
COLUMN_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
,
new
CoverOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TIME_BUCKET
,
new
NonOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
new
AddOperation
()),
};
private
static
final
Column
[]
DOUBLE_COLUMNS
=
{};
...
...
@@ -63,43 +71,107 @@ public class ServiceMetric extends Data {
setDataInteger
(
0
,
serviceId
);
}
public
long
getCalls
()
{
public
Long
getTimeBucket
()
{
return
getDataLong
(
0
);
}
public
void
set
Calls
(
long
calls
)
{
setDataLong
(
0
,
calls
);
public
void
set
TimeBucket
(
Long
timeBucket
)
{
setDataLong
(
0
,
timeBucket
);
}
public
long
getError
Calls
()
{
public
Long
getTransaction
Calls
()
{
return
getDataLong
(
1
);
}
public
void
set
ErrorCalls
(
long
error
Calls
)
{
setDataLong
(
1
,
error
Calls
);
public
void
set
TransactionCalls
(
Long
transaction
Calls
)
{
setDataLong
(
1
,
transaction
Calls
);
}
public
long
getDurationSum
()
{
public
Long
getTransactionErrorCalls
()
{
return
getDataLong
(
2
);
}
public
void
set
DurationSum
(
long
durationSum
)
{
setDataLong
(
2
,
durationSum
);
public
void
set
TransactionErrorCalls
(
Long
transactionErrorCalls
)
{
setDataLong
(
2
,
transactionErrorCalls
);
}
public
long
getError
DurationSum
()
{
public
Long
getTransaction
DurationSum
()
{
return
getDataLong
(
3
);
}
public
void
set
ErrorDurationSum
(
long
error
DurationSum
)
{
setDataLong
(
3
,
error
DurationSum
);
public
void
set
TransactionDurationSum
(
Long
transaction
DurationSum
)
{
setDataLong
(
3
,
transaction
DurationSum
);
}
public
Long
getT
imeBucket
()
{
public
Long
getT
ransactionErrorDurationSum
()
{
return
getDataLong
(
4
);
}
public
void
setTimeBucket
(
Long
timeBucket
)
{
setDataLong
(
4
,
timeBucket
);
public
void
setTransactionErrorDurationSum
(
Long
transactionErrorDurationSum
)
{
setDataLong
(
4
,
transactionErrorDurationSum
);
}
public
Long
getBusinessTransactionCalls
()
{
return
getDataLong
(
5
);
}
public
void
setBusinessTransactionCalls
(
Long
businessTransactionCalls
)
{
setDataLong
(
5
,
businessTransactionCalls
);
}
public
Long
getBusinessTransactionErrorCalls
()
{
return
getDataLong
(
6
);
}
public
void
setBusinessTransactionErrorCalls
(
Long
businessTransactionErrorCalls
)
{
setDataLong
(
6
,
businessTransactionErrorCalls
);
}
public
Long
getBusinessTransactionDurationSum
()
{
return
getDataLong
(
7
);
}
public
void
setBusinessTransactionDurationSum
(
Long
businessTransactionDurationSum
)
{
setDataLong
(
7
,
businessTransactionDurationSum
);
}
public
Long
getBusinessTransactionErrorDurationSum
()
{
return
getDataLong
(
8
);
}
public
void
setBusinessTransactionErrorDurationSum
(
Long
businessTransactionErrorDurationSum
)
{
setDataLong
(
8
,
businessTransactionErrorDurationSum
);
}
public
Long
getMqTransactionCalls
()
{
return
getDataLong
(
9
);
}
public
void
setMqTransactionCalls
(
Long
mqTransactionCalls
)
{
setDataLong
(
9
,
mqTransactionCalls
);
}
public
Long
getMqTransactionErrorCalls
()
{
return
getDataLong
(
10
);
}
public
void
setMqTransactionErrorCalls
(
Long
mqTransactionErrorCalls
)
{
setDataLong
(
10
,
mqTransactionErrorCalls
);
}
public
Long
getMqTransactionDurationSum
()
{
return
getDataLong
(
11
);
}
public
void
setMqTransactionDurationSum
(
Long
mqTransactionDurationSum
)
{
setDataLong
(
11
,
mqTransactionDurationSum
);
}
public
Long
getMqTransactionErrorDurationSum
()
{
return
getDataLong
(
12
);
}
public
void
setMqTransactionErrorDurationSum
(
Long
mqTransactionErrorDurationSum
)
{
setDataLong
(
12
,
mqTransactionErrorDurationSum
);
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceMetricTable.java
浏览文件 @
e64e2c3f
...
...
@@ -18,16 +18,12 @@
package
org.skywalking.apm.collector.storage.table.service
;
import
org.skywalking.apm.collector.
core.data.Common
Table
;
import
org.skywalking.apm.collector.
storage.table.CommonMetric
Table
;
/**
* @author peng-yongsheng
*/
public
class
ServiceMetricTable
extends
CommonTable
{
public
class
ServiceMetricTable
extends
Common
Metric
Table
{
public
static
final
String
TABLE
=
"service_metric"
;
public
static
final
String
COLUMN_SERVICE_ID
=
"service_id"
;
public
static
final
String
COLUMN_CALLS
=
"calls"
;
public
static
final
String
COLUMN_ERROR_CALLS
=
"error_calls"
;
public
static
final
String
COLUMN_DURATION_SUM
=
"duration_sum"
;
public
static
final
String
COLUMN_ERROR_DURATION_SUM
=
"error_duration_sum"
;
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceReferenceMetric.java
浏览文件 @
e64e2c3f
...
...
@@ -21,7 +21,6 @@ package org.skywalking.apm.collector.storage.table.service;
import
org.skywalking.apm.collector.core.data.Column
;
import
org.skywalking.apm.collector.core.data.Data
;
import
org.skywalking.apm.collector.core.data.operator.AddOperation
;
import
org.skywalking.apm.collector.core.data.operator.CoverOperation
;
import
org.skywalking.apm.collector.core.data.operator.NonOperation
;
/**
...
...
@@ -34,6 +33,8 @@ public class ServiceReferenceMetric extends Data {
};
private
static
final
Column
[]
LONG_COLUMNS
=
{
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TIME_BUCKET
,
new
NonOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
new
AddOperation
()),
...
...
@@ -46,7 +47,6 @@ public class ServiceReferenceMetric extends Data {
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
new
AddOperation
()),
new
Column
(
ServiceReferenceMetricTable
.
COLUMN_TIME_BUCKET
,
new
CoverOperation
()),
};
private
static
final
Column
[]
DOUBLE_COLUMNS
=
{};
...
...
@@ -89,107 +89,107 @@ public class ServiceReferenceMetric extends Data {
setDataInteger
(
2
,
behindServiceId
);
}
public
Long
getT
ransactionCalls
()
{
public
Long
getT
imeBucket
()
{
return
getDataLong
(
0
);
}
public
void
setTimeBucket
(
Long
timeBucket
)
{
setDataLong
(
0
,
timeBucket
);
}
public
Long
getTransactionCalls
()
{
return
getDataLong
(
1
);
}
public
void
setTransactionCalls
(
Long
transactionCalls
)
{
setDataLong
(
0
,
transactionCalls
);
setDataLong
(
1
,
transactionCalls
);
}
public
Long
getTransactionErrorCalls
()
{
return
getDataLong
(
1
);
return
getDataLong
(
2
);
}
public
void
setTransactionErrorCalls
(
Long
transactionErrorCalls
)
{
setDataLong
(
1
,
transactionErrorCalls
);
setDataLong
(
2
,
transactionErrorCalls
);
}
public
Long
getTransactionDurationSum
()
{
return
getDataLong
(
2
);
return
getDataLong
(
3
);
}
public
void
setTransactionDurationSum
(
Long
transactionDurationSum
)
{
setDataLong
(
2
,
transactionDurationSum
);
setDataLong
(
3
,
transactionDurationSum
);
}
public
Long
getTransactionErrorDurationSum
()
{
return
getDataLong
(
3
);
return
getDataLong
(
4
);
}
public
void
setTransactionErrorDurationSum
(
Long
transactionErrorDurationSum
)
{
setDataLong
(
3
,
transactionErrorDurationSum
);
setDataLong
(
4
,
transactionErrorDurationSum
);
}
public
Long
getBusinessTransactionCalls
()
{
return
getDataLong
(
4
);
return
getDataLong
(
5
);
}
public
void
setBusinessTransactionCalls
(
Long
businessTransactionCalls
)
{
setDataLong
(
4
,
businessTransactionCalls
);
setDataLong
(
5
,
businessTransactionCalls
);
}
public
Long
getBusinessTransactionErrorCalls
()
{
return
getDataLong
(
5
);
return
getDataLong
(
6
);
}
public
void
setBusinessTransactionErrorCalls
(
Long
businessTransactionErrorCalls
)
{
setDataLong
(
5
,
businessTransactionErrorCalls
);
setDataLong
(
6
,
businessTransactionErrorCalls
);
}
public
Long
getBusinessTransactionDurationSum
()
{
return
getDataLong
(
6
);
return
getDataLong
(
7
);
}
public
void
setBusinessTransactionDurationSum
(
Long
businessTransactionDurationSum
)
{
setDataLong
(
6
,
businessTransactionDurationSum
);
setDataLong
(
7
,
businessTransactionDurationSum
);
}
public
Long
getBusinessTransactionErrorDurationSum
()
{
return
getDataLong
(
7
);
return
getDataLong
(
8
);
}
public
void
setBusinessTransactionErrorDurationSum
(
Long
businessTransactionErrorDurationSum
)
{
setDataLong
(
7
,
businessTransactionErrorDurationSum
);
setDataLong
(
8
,
businessTransactionErrorDurationSum
);
}
public
Long
getMqTransactionCalls
()
{
return
getDataLong
(
8
);
return
getDataLong
(
9
);
}
public
void
setMqTransactionCalls
(
Long
mqTransactionCalls
)
{
setDataLong
(
8
,
mqTransactionCalls
);
setDataLong
(
9
,
mqTransactionCalls
);
}
public
Long
getMqTransactionErrorCalls
()
{
return
getDataLong
(
9
);
return
getDataLong
(
10
);
}
public
void
setMqTransactionErrorCalls
(
Long
mqTransactionErrorCalls
)
{
setDataLong
(
9
,
mqTransactionErrorCalls
);
setDataLong
(
10
,
mqTransactionErrorCalls
);
}
public
Long
getMqTransactionDurationSum
()
{
return
getDataLong
(
1
0
);
return
getDataLong
(
1
1
);
}
public
void
setMqTransactionDurationSum
(
Long
mqTransactionDurationSum
)
{
setDataLong
(
1
0
,
mqTransactionDurationSum
);
setDataLong
(
1
1
,
mqTransactionDurationSum
);
}
public
Long
getMqTransactionErrorDurationSum
()
{
return
getDataLong
(
11
);
}
public
void
setMqTransactionErrorDurationSum
(
Long
mqTransactionErrorDurationSum
)
{
setDataLong
(
11
,
mqTransactionErrorDurationSum
);
}
public
Long
getTimeBucket
()
{
return
getDataLong
(
12
);
}
public
void
set
TimeBucket
(
Long
timeBucket
)
{
setDataLong
(
12
,
timeBucket
);
public
void
set
MqTransactionErrorDurationSum
(
Long
mqTransactionErrorDurationSum
)
{
setDataLong
(
12
,
mqTransactionErrorDurationSum
);
}
}
apm-collector/apm-collector-storage/collector-storage-define/src/main/java/org/skywalking/apm/collector/storage/table/service/ServiceReferenceMetricTable.java
浏览文件 @
e64e2c3f
...
...
@@ -18,26 +18,14 @@
package
org.skywalking.apm.collector.storage.table.service
;
import
org.skywalking.apm.collector.
core.data.Common
Table
;
import
org.skywalking.apm.collector.
storage.table.CommonMetric
Table
;
/**
* @author peng-yongsheng
*/
public
class
ServiceReferenceMetricTable
extends
CommonTable
{
public
class
ServiceReferenceMetricTable
extends
Common
Metric
Table
{
public
static
final
String
TABLE
=
"service_reference_metric"
;
public
static
final
String
COLUMN_ENTRY_SERVICE_ID
=
"entry_service_id"
;
public
static
final
String
COLUMN_FRONT_SERVICE_ID
=
"front_service_id"
;
public
static
final
String
COLUMN_BEHIND_SERVICE_ID
=
"behind_service_id"
;
public
static
final
String
COLUMN_TRANSACTION_CALLS
=
"transaction_calls"
;
public
static
final
String
COLUMN_TRANSACTION_ERROR_CALLS
=
"transaction_error_calls"
;
public
static
final
String
COLUMN_TRANSACTION_DURATION_SUM
=
"transaction_duration_sum"
;
public
static
final
String
COLUMN_TRANSACTION_ERROR_DURATION_SUM
=
"transaction_error_duration_sum"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_CALLS
=
"business_transaction_calls"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
=
"business_transaction_error_calls"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
=
"business_transaction_duration_sum"
;
public
static
final
String
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
=
"business_transaction_error_duration_sum"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_CALLS
=
"mq_transaction_calls"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_ERROR_CALLS
=
"mq_transaction_error_calls"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_DURATION_SUM
=
"mq_transaction_duration_sum"
;
public
static
final
String
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
=
"mq_transaction_error_duration_sum"
;
}
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/dao/ServiceMetricEsPersistenceDAO.java
浏览文件 @
e64e2c3f
...
...
@@ -51,10 +51,22 @@ public class ServiceMetricEsPersistenceDAO extends EsDAO implements IServiceMetr
ServiceMetric
serviceMetric
=
new
ServiceMetric
(
id
);
Map
<
String
,
Object
>
source
=
getResponse
.
getSource
();
serviceMetric
.
setServiceId
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
)).
intValue
());
serviceMetric
.
setCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_CALLS
)).
longValue
());
serviceMetric
.
setErrorCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
)).
longValue
());
serviceMetric
.
setDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
)).
longValue
());
serviceMetric
.
setErrorDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
)).
longValue
());
serviceMetric
.
setTransactionCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
)).
longValue
());
serviceMetric
.
setTransactionErrorCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
)).
longValue
());
serviceMetric
.
setTransactionDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
)).
longValue
());
serviceMetric
.
setTransactionErrorDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
)).
longValue
());
serviceMetric
.
setBusinessTransactionCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
)).
longValue
());
serviceMetric
.
setBusinessTransactionErrorCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
)).
longValue
());
serviceMetric
.
setBusinessTransactionDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
)).
longValue
());
serviceMetric
.
setBusinessTransactionErrorDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
)).
longValue
());
serviceMetric
.
setMqTransactionCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
)).
longValue
());
serviceMetric
.
setMqTransactionErrorCalls
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
)).
longValue
());
serviceMetric
.
setMqTransactionDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
)).
longValue
());
serviceMetric
.
setMqTransactionErrorDurationSum
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
)).
longValue
());
serviceMetric
.
setTimeBucket
(((
Number
)
source
.
get
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
)).
longValue
());
return
serviceMetric
;
}
else
{
...
...
@@ -65,10 +77,22 @@ public class ServiceMetricEsPersistenceDAO extends EsDAO implements IServiceMetr
@Override
public
IndexRequestBuilder
prepareBatchInsert
(
ServiceMetric
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
,
data
.
getServiceId
());
source
.
put
(
ServiceMetricTable
.
COLUMN_CALLS
,
data
.
getCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
,
data
.
getErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
,
data
.
getDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
,
data
.
getErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
data
.
getTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
data
.
getTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
data
.
getTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
,
data
.
getBusinessTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
,
data
.
getBusinessTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
,
data
.
getBusinessTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getBusinessTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
,
data
.
getMqTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
data
.
getMqTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
data
.
getMqTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getMqTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareIndex
(
ServiceMetricTable
.
TABLE
,
data
.
getId
()).
setSource
(
source
);
...
...
@@ -77,10 +101,22 @@ public class ServiceMetricEsPersistenceDAO extends EsDAO implements IServiceMetr
@Override
public
UpdateRequestBuilder
prepareBatchUpdate
(
ServiceMetric
data
)
{
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
,
data
.
getServiceId
());
source
.
put
(
ServiceMetricTable
.
COLUMN_CALLS
,
data
.
getCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
,
data
.
getErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
,
data
.
getDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
,
data
.
getErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
data
.
getTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
data
.
getTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
data
.
getTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
,
data
.
getBusinessTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
,
data
.
getBusinessTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
,
data
.
getBusinessTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getBusinessTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
,
data
.
getMqTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
data
.
getMqTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
data
.
getMqTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getMqTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
return
getClient
().
prepareUpdate
(
ServiceMetricTable
.
TABLE
,
data
.
getId
()).
setDoc
(
source
);
...
...
apm-collector/apm-collector-storage/collector-storage-es-provider/src/main/java/org/skywalking/apm/collector/storage/es/define/ServiceMetricEsTableDefine.java
浏览文件 @
e64e2c3f
...
...
@@ -38,10 +38,22 @@ public class ServiceMetricEsTableDefine extends ElasticSearchTableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_AGG
,
ElasticSearchColumnDefine
.
Type
.
Keyword
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
,
ElasticSearchColumnDefine
.
Type
.
Integer
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
addColumn
(
new
ElasticSearchColumnDefine
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
,
ElasticSearchColumnDefine
.
Type
.
Long
.
name
()));
}
}
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/ServiceMetricH2PersistenceDAO.java
浏览文件 @
e64e2c3f
...
...
@@ -56,10 +56,22 @@ public class ServiceMetricH2PersistenceDAO extends H2DAO implements IServiceMetr
if
(
rs
.
next
())
{
ServiceMetric
serviceMetric
=
new
ServiceMetric
(
id
);
serviceMetric
.
setServiceId
(
rs
.
getInt
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
));
serviceMetric
.
setCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_CALLS
));
serviceMetric
.
setErrorCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
));
serviceMetric
.
setDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
));
serviceMetric
.
setErrorDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
));
serviceMetric
.
setTransactionCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
));
serviceMetric
.
setTransactionErrorCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
));
serviceMetric
.
setTransactionDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
));
serviceMetric
.
setTransactionErrorDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
));
serviceMetric
.
setBusinessTransactionCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
));
serviceMetric
.
setBusinessTransactionErrorCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
));
serviceMetric
.
setBusinessTransactionDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
));
serviceMetric
.
setBusinessTransactionErrorDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
));
serviceMetric
.
setMqTransactionCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
));
serviceMetric
.
setMqTransactionErrorCalls
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
));
serviceMetric
.
setMqTransactionDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
));
serviceMetric
.
setMqTransactionErrorDurationSum
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
));
serviceMetric
.
setTimeBucket
(
rs
.
getLong
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
));
return
serviceMetric
;
}
...
...
@@ -75,10 +87,22 @@ public class ServiceMetricH2PersistenceDAO extends H2DAO implements IServiceMetr
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceMetricTable
.
COLUMN_ID
,
data
.
getId
());
source
.
put
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
,
data
.
getServiceId
());
source
.
put
(
ServiceMetricTable
.
COLUMN_CALLS
,
data
.
getCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
,
data
.
getErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
,
data
.
getDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
,
data
.
getErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
data
.
getTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
data
.
getTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
data
.
getTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
,
data
.
getBusinessTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
,
data
.
getBusinessTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
,
data
.
getBusinessTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getBusinessTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
,
data
.
getMqTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
data
.
getMqTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
data
.
getMqTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getMqTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
String
sql
=
SqlBuilder
.
buildBatchInsertSql
(
ServiceMetricTable
.
TABLE
,
source
.
keySet
());
...
...
@@ -92,10 +116,22 @@ public class ServiceMetricH2PersistenceDAO extends H2DAO implements IServiceMetr
H2SqlEntity
entity
=
new
H2SqlEntity
();
Map
<
String
,
Object
>
source
=
new
HashMap
<>();
source
.
put
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
,
data
.
getServiceId
());
source
.
put
(
ServiceMetricTable
.
COLUMN_CALLS
,
data
.
getCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
,
data
.
getErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
,
data
.
getDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
,
data
.
getErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
data
.
getTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
data
.
getTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
data
.
getTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
,
data
.
getBusinessTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
,
data
.
getBusinessTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
,
data
.
getBusinessTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getBusinessTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
,
data
.
getMqTransactionCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
data
.
getMqTransactionErrorCalls
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
data
.
getMqTransactionDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
data
.
getMqTransactionErrorDurationSum
());
source
.
put
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
,
data
.
getTimeBucket
());
String
sql
=
SqlBuilder
.
buildBatchUpdateSql
(
ServiceMetricTable
.
TABLE
,
source
.
keySet
(),
ServiceMetricTable
.
COLUMN_ID
);
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/define/ServiceMetricH2TableDefine.java
浏览文件 @
e64e2c3f
...
...
@@ -34,10 +34,22 @@ public class ServiceMetricH2TableDefine extends H2TableDefine {
@Override
public
void
initialize
()
{
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_ID
,
H2ColumnDefine
.
Type
.
Varchar
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_SERVICE_ID
,
H2ColumnDefine
.
Type
.
Int
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_ERROR_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_ERROR_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_TRANSACTION_ERROR_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_BUSINESS_TRANSACTION_ERROR_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_CALLS
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_MQ_TRANSACTION_ERROR_DURATION_SUM
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
addColumn
(
new
H2ColumnDefine
(
ServiceMetricTable
.
COLUMN_TIME_BUCKET
,
H2ColumnDefine
.
Type
.
Bigint
.
name
()));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录