forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pinpoint-apm#9631] Format values as a chart
- Loading branch information
Showing
5 changed files
with
228 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
.../src/main/java/com/navercorp/pinpoint/exceptiontrace/web/mapper/ExceptionModelMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright 2024 NAVER Corp. | ||
* | ||
* 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. | ||
*/ | ||
package com.navercorp.pinpoint.exceptiontrace.web.mapper; | ||
|
||
import com.navercorp.pinpoint.common.server.mapper.MapStructUtils; | ||
import com.navercorp.pinpoint.common.server.util.timewindow.TimeWindow; | ||
import com.navercorp.pinpoint.exceptiontrace.web.model.ExceptionGroupSummary; | ||
import com.navercorp.pinpoint.exceptiontrace.web.model.GroupedFieldName; | ||
import com.navercorp.pinpoint.exceptiontrace.web.model.params.GroupFilterParams; | ||
import com.navercorp.pinpoint.exceptiontrace.web.util.TimeSeriesUtils; | ||
import com.navercorp.pinpoint.exceptiontrace.web.view.ExceptionChartValueView; | ||
import com.navercorp.pinpoint.exceptiontrace.web.view.ExceptionChartView; | ||
import com.navercorp.pinpoint.exceptiontrace.web.view.ExceptionGroupSummaryView; | ||
import org.mapstruct.AfterMapping; | ||
import org.mapstruct.CollectionMappingStrategy; | ||
import org.mapstruct.InjectionStrategy; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.MappingTarget; | ||
import org.mapstruct.Mappings; | ||
import org.mapstruct.Named; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author intr3p1d | ||
*/ | ||
@Mapper( | ||
componentModel = "spring", | ||
injectionStrategy = InjectionStrategy.CONSTRUCTOR, | ||
uses = { | ||
} | ||
) | ||
public interface ExceptionModelMapper { | ||
|
||
@Mappings({ | ||
@Mapping(target = "chart", ignore = true), | ||
}) | ||
ExceptionGroupSummaryView toSummaryView ( | ||
ExceptionGroupSummary summary, | ||
TimeWindow timeWindow | ||
); | ||
|
||
@AfterMapping | ||
default void addChartView( | ||
ExceptionGroupSummary summary, | ||
TimeWindow timeWindow, | ||
@MappingTarget ExceptionGroupSummaryView summaryView | ||
) { | ||
ExceptionChartValueView exceptionChartValueView = new ExceptionChartValueView(summary.getValues()); | ||
exceptionChartValueView.setGroupedFieldName(summary.getGroupedFieldName()); | ||
|
||
summaryView.setChart(TimeSeriesUtils.newChartView( | ||
"summary", timeWindow, | ||
List.of(exceptionChartValueView) | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
...c/main/java/com/navercorp/pinpoint/exceptiontrace/web/view/ExceptionGroupSummaryView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
/* | ||
* Copyright 2024 NAVER Corp. | ||
* | ||
* 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. | ||
*/ | ||
package com.navercorp.pinpoint.exceptiontrace.web.view; | ||
|
||
import com.navercorp.pinpoint.exceptiontrace.web.model.GroupedFieldName; | ||
import com.navercorp.pinpoint.exceptiontrace.web.model.params.GroupFilterParams; | ||
import com.navercorp.pinpoint.exceptiontrace.web.model.params.TransactionSearchParams; | ||
|
||
|
||
/** | ||
* @author intr3p1d | ||
*/ | ||
public class ExceptionGroupSummaryView { | ||
|
||
private ExceptionChartView chart; | ||
private long count; | ||
|
||
private GroupedFieldName groupedFieldName; | ||
private GroupFilterParams groupFilterParams; | ||
|
||
private String mostRecentErrorClass; | ||
private String mostRecentErrorMessage; | ||
private String firstLineOfClassName; | ||
private String firstLineOfMethodName; | ||
private long firstOccurred; | ||
private long lastOccurred; | ||
|
||
private TransactionSearchParams lastTransactionSearchParams; | ||
|
||
|
||
public ExceptionGroupSummaryView() { | ||
} | ||
|
||
public ExceptionChartView getChart() { | ||
return chart; | ||
} | ||
|
||
public void setChart(ExceptionChartView chart) { | ||
this.chart = chart; | ||
} | ||
|
||
public long getCount() { | ||
return count; | ||
} | ||
|
||
public void setCount(long count) { | ||
this.count = count; | ||
} | ||
|
||
public GroupedFieldName getGroupedFieldName() { | ||
return groupedFieldName; | ||
} | ||
|
||
public void setGroupedFieldName(GroupedFieldName groupedFieldName) { | ||
this.groupedFieldName = groupedFieldName; | ||
} | ||
|
||
public GroupFilterParams getGroupFilterParams() { | ||
return groupFilterParams; | ||
} | ||
|
||
public void setGroupFilterParams(GroupFilterParams groupFilterParams) { | ||
this.groupFilterParams = groupFilterParams; | ||
} | ||
|
||
public String getMostRecentErrorClass() { | ||
return mostRecentErrorClass; | ||
} | ||
|
||
public void setMostRecentErrorClass(String mostRecentErrorClass) { | ||
this.mostRecentErrorClass = mostRecentErrorClass; | ||
} | ||
|
||
public String getMostRecentErrorMessage() { | ||
return mostRecentErrorMessage; | ||
} | ||
|
||
public void setMostRecentErrorMessage(String mostRecentErrorMessage) { | ||
this.mostRecentErrorMessage = mostRecentErrorMessage; | ||
} | ||
|
||
public String getFirstLineOfClassName() { | ||
return firstLineOfClassName; | ||
} | ||
|
||
public void setFirstLineOfClassName(String firstLineOfClassName) { | ||
this.firstLineOfClassName = firstLineOfClassName; | ||
} | ||
|
||
public String getFirstLineOfMethodName() { | ||
return firstLineOfMethodName; | ||
} | ||
|
||
public void setFirstLineOfMethodName(String firstLineOfMethodName) { | ||
this.firstLineOfMethodName = firstLineOfMethodName; | ||
} | ||
|
||
public long getFirstOccurred() { | ||
return firstOccurred; | ||
} | ||
|
||
public void setFirstOccurred(long firstOccurred) { | ||
this.firstOccurred = firstOccurred; | ||
} | ||
|
||
public long getLastOccurred() { | ||
return lastOccurred; | ||
} | ||
|
||
public void setLastOccurred(long lastOccurred) { | ||
this.lastOccurred = lastOccurred; | ||
} | ||
|
||
public TransactionSearchParams getLastTransactionSearchParams() { | ||
return lastTransactionSearchParams; | ||
} | ||
|
||
public void setLastTransactionSearchParams(TransactionSearchParams lastTransactionSearchParams) { | ||
this.lastTransactionSearchParams = lastTransactionSearchParams; | ||
} | ||
} |