Skip to content

Commit f8a4b7e

Browse files
committed
refactoring.
1 parent d5eac79 commit f8a4b7e

File tree

3 files changed

+53
-8
lines changed

3 files changed

+53
-8
lines changed

‎web/src/main/java/com/navercorp/pinpoint/web/view/TransactionInfoCallStackSerializer.java‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2015 NAVER Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.navercorp.pinpoint.web.view;
217

318
import com.fasterxml.jackson.core.JsonGenerator;
@@ -8,7 +23,7 @@
823
import java.io.IOException;
924

1025
/**
11-
* Created by Naver on 2015-10-22.
26+
* @author jaehong.kim
1227
*/
1328
public class TransactionInfoCallStackSerializer extends JsonSerializer<TransactionInfoViewModel.CallStack> {
1429

‎web/src/main/java/com/navercorp/pinpoint/web/view/TransactionInfoViewModel.java‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2015 NAVER Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.navercorp.pinpoint.web.view;
217

318
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -16,7 +31,7 @@
1631
import java.util.*;
1732

1833
/**
19-
* Created by Naver on 2015-10-21.
34+
* @author jaehong.kim
2035
*/
2136
public class TransactionInfoViewModel {
2237

@@ -135,14 +150,15 @@ public List<CallStack> getCallStack() {
135150
long barRatio = 0;
136151
for(Record record : recordSet.getRecordList()) {
137152
if(first) {
138-
long begin = record.getBegin();
139-
long end = record.getBegin() + record.getElapsed();
140-
if(end - begin > 0) {
141-
barRatio = 100 / (end - begin);
153+
if(record.isMethod()) {
154+
long begin = record.getBegin();
155+
long end = record.getBegin() + record.getElapsed();
156+
if(end - begin > 0) {
157+
barRatio = 100 / (end - begin);
158+
}
142159
}
143160
first = false;
144161
}
145-
// TODO
146162
list.add(new CallStack(record, barRatio));
147163
}
148164

‎web/src/main/java/com/navercorp/pinpoint/web/view/TransactionMetaDataViewModel.java‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2015 NAVER Corp.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116
package com.navercorp.pinpoint.web.view;
217

318
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -28,7 +43,6 @@ public List<MetaData> getMetadata() {
2843
return list;
2944
}
3045

31-
//@JsonSerialize(using=TransactionMetaDataSerializer.class)
3246
public static class MetaData {
3347
private SpanBo span;
3448

0 commit comments

Comments
 (0)