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.
- Loading branch information
Showing
15 changed files
with
526 additions
and
72 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
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
70 changes: 70 additions & 0 deletions
70
metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/mapping/Field.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,70 @@ | ||
/* | ||
* 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.mapping; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.navercorp.pinpoint.metric.common.model.Tag; | ||
import com.navercorp.pinpoint.metric.web.model.basic.metric.group.MatchingRule; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
|
||
public class Field { | ||
private final String name; | ||
private final List<Tag> tags; | ||
private final MatchingRule matchingRule; | ||
|
||
@JsonCreator | ||
public Field(@JsonProperty("name") String name, | ||
@JsonProperty("tags") List<Tag> tags, | ||
@JsonProperty("matchingRule") MatchingRule matchingRule) { | ||
this.name = Objects.requireNonNull(name, "name"); | ||
this.tags = defaultTags(tags); | ||
this.matchingRule = Objects.requireNonNull(matchingRule, "matchingRule"); | ||
} | ||
|
||
private List<Tag> defaultTags(List<Tag> tags) { | ||
if (tags == null) { | ||
return Collections.emptyList(); | ||
} | ||
return tags; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public List<Tag> getTags() { | ||
return tags; | ||
} | ||
|
||
public MatchingRule getMatchingRule() { | ||
return matchingRule; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Field{" + | ||
"name='" + name + '\'' + | ||
", tags=" + tags + | ||
", matchingRule=" + matchingRule + | ||
'}'; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/mapping/Mappings.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.mapping; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class Mappings { | ||
|
||
private final List<Metric> mappings; | ||
|
||
@JsonCreator | ||
public Mappings(@JsonProperty("mappings") List<Metric> mappings) { | ||
this.mappings = Objects.requireNonNull(mappings, "mappings"); | ||
} | ||
|
||
public List<Metric> getMappings() { | ||
return mappings; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Mappings{" + | ||
"groups=" + mappings + | ||
'}'; | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
metric-module/metric/src/main/java/com/navercorp/pinpoint/metric/web/mapping/Metric.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,84 @@ | ||
/* | ||
* 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.mapping; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.navercorp.pinpoint.metric.web.model.basic.metric.group.GroupingRule; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class Metric { | ||
private final String name; | ||
private final String title; | ||
private final String definitionId; | ||
private final GroupingRule grouping; | ||
private final String unit; | ||
private final List<Field> fields; | ||
|
||
@JsonCreator | ||
public Metric(@JsonProperty("name") String name, | ||
@JsonProperty("title") String title, | ||
@JsonProperty("definitionId") String definitionId, | ||
@JsonProperty("grouping") GroupingRule grouping, | ||
@JsonProperty("unit") String unit, | ||
@JsonProperty("fields") List<Field> fields) { | ||
this.name = Objects.requireNonNull(name, "name"); | ||
this.title = Objects.requireNonNull(title, "title"); | ||
this.definitionId = Objects.requireNonNull(definitionId, "definitionId"); | ||
this.grouping = Objects.requireNonNull(grouping, "grouping"); | ||
this.unit = Objects.requireNonNull(unit, "unit"); | ||
this.fields = Objects.requireNonNull(fields, "fields"); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public String getDefinitionId() { | ||
return definitionId; | ||
} | ||
|
||
public GroupingRule getGrouping() { | ||
return grouping; | ||
} | ||
|
||
public String getUnit() { | ||
return unit; | ||
} | ||
|
||
public List<Field> getFields() { | ||
return fields; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Metric{" + | ||
"name='" + name + '\'' + | ||
", title='" + title + '\'' + | ||
", definitionId='" + definitionId + '\'' + | ||
", grouping=" + grouping + | ||
", unit='" + unit + '\'' + | ||
", fields=" + fields + | ||
'}'; | ||
} | ||
} |
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.