forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pinpoint-apm#8004] support multi grouping by tag data
- Loading branch information
1 parent
9ab644d
commit 0860017
Showing
10 changed files
with
381 additions
and
15 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...module/metric/src/main/java/com/navercorp/pinpoint/metric/web/model/MetricValueGroup.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,44 @@ | ||
/* | ||
* Copyright 2021 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.metric.web.model; | ||
|
||
import com.navercorp.pinpoint.metric.common.model.StringPrecondition; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* @author minwoo.jung | ||
*/ | ||
public class MetricValueGroup<Y extends Number> { | ||
|
||
private final String groupName; | ||
private final List<MetricValue<Y>> metricValueList; | ||
|
||
public MetricValueGroup(List<MetricValue<Y>> metricValueList, String groupName) { | ||
this.groupName = StringPrecondition.requireHasLength(groupName, "groupName"); | ||
this.metricValueList = Objects.requireNonNull(metricValueList, "metricValueList");; | ||
} | ||
|
||
public List<MetricValue<Y>> getMetricValueList() { | ||
return metricValueList; | ||
} | ||
|
||
public String getGroupName() { | ||
return groupName; | ||
} | ||
} |
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
53 changes: 53 additions & 0 deletions
53
...rc/main/java/com/navercorp/pinpoint/metric/web/model/basic/metric/group/GroupingRule.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,53 @@ | ||
/* | ||
* Copyright 2021 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.metric.web.model.basic.metric.group; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* @author minwoo.jung | ||
*/ | ||
public enum GroupingRule { | ||
TAG(1, "tag"), | ||
UNKNOWN(100, "unknown"); | ||
|
||
private final int code; | ||
private final String value; | ||
|
||
GroupingRule(int code, String value) { | ||
this.code = code; | ||
this.value = Objects.requireNonNull(value, "value"); | ||
} | ||
|
||
public static GroupingRule getByCode(int code) { | ||
for (GroupingRule groupingRule : GroupingRule.values()) { | ||
if (groupingRule.code == code) { | ||
return groupingRule; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unknown code : " + code); | ||
} | ||
|
||
public static GroupingRule getByValue(String value) { | ||
for (GroupingRule groupingRule : GroupingRule.values()) { | ||
if (groupingRule.value.equalsIgnoreCase(value)) { | ||
return groupingRule; | ||
} | ||
} | ||
throw new IllegalArgumentException("Unknown value : " + value); | ||
} | ||
} |
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
Oops, something went wrong.