Skip to content

Commit ed3f762

Browse files
guoyuepengtoyboxman
authored andcommitted
metric tags
1 parent 281f826 commit ed3f762

File tree

7 files changed

+126
-16
lines changed

7 files changed

+126
-16
lines changed

griffin-metric/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ under the License.
2828
<version>2.0.0-SNAPSHOT</version>
2929
</parent>
3030

31-
3231
<artifactId>griffin-metric</artifactId>
3332
<name>${project.artifactId}</name>
3433
<packaging>jar</packaging>

griffin-metric/readme.md

Whitespace-only changes.

griffin-metric/src/main/java/org/apache/griffin/metric/model/BaseEntity.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ Licensed to the Apache Software Foundation (ASF) under one
1818
*/
1919
package org.apache.griffin.metric.model;
2020

21-
import java.util.Date;
22-
2321
import lombok.Data;
2422

23+
import java.util.Date;
2524

26-
25+
/**
26+
* A base class in metric function in griffin, which contains timestamp properties of entity creation/update.
27+
*/
2728
@Data
2829
public abstract class BaseEntity implements java.io.Serializable {
2930

griffin-metric/src/main/java/org/apache/griffin/metric/model/MetricD.java

+21-6
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,39 @@ Licensed to the Apache Software Foundation (ASF) under one
1818
*/
1919
package org.apache.griffin.metric.model;
2020

21-
import lombok.*;
22-
23-
import java.util.Map;
24-
21+
import lombok.AllArgsConstructor;
22+
import lombok.Builder;
23+
import lombok.Data;
24+
import lombok.EqualsAndHashCode;
25+
import lombok.NoArgsConstructor;
26+
27+
/**
28+
* A metric definition entity represents fundamental metadata.
29+
*/
2530
@Builder
2631
@Data
2732
@NoArgsConstructor
2833
@AllArgsConstructor
2934
@EqualsAndHashCode(callSuper = false)
3035
public class MetricD extends BaseEntity {
3136

37+
/**
38+
* An unique identity for a metric.
39+
*/
3240
private long metricId;
3341

42+
/**
43+
* The name of a metric entity.
44+
*/
3445
private String metricName;
3546

47+
/**
48+
* The owner of a metric entity.
49+
*/
3650
private String owner;
3751

52+
/**
53+
* The details of a metric entity.
54+
*/
3855
private String description;
39-
40-
private Map<String, String> tags;
4156
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one
3+
or more contributor license agreements. See the NOTICE file
4+
distributed with this work for additional information
5+
regarding copyright ownership. The ASF licenses this file
6+
to you under the Apache License, Version 2.0 (the
7+
"License"); you may not use this file except in compliance
8+
with the License. You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing,
13+
software distributed under the License is distributed on an
14+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
KIND, either express or implied. See the License for the
16+
specific language governing permissions and limitations
17+
under the License.
18+
*/
19+
package org.apache.griffin.metric.model;
20+
21+
import lombok.AllArgsConstructor;
22+
import lombok.Builder;
23+
import lombok.Data;
24+
import lombok.EqualsAndHashCode;
25+
import lombok.NoArgsConstructor;
26+
27+
/**
28+
* A metric tag entity represents fundamental information.
29+
*/
30+
@Builder
31+
@Data
32+
@NoArgsConstructor
33+
@AllArgsConstructor
34+
@EqualsAndHashCode(callSuper = false)
35+
public class MetricTag extends BaseEntity {
36+
37+
/**
38+
* An unique identity for a metric tag.
39+
*/
40+
private long id;
41+
42+
/**
43+
* Key name
44+
*/
45+
private String tagKey;
46+
47+
/**
48+
* The value corresponding to a key
49+
*/
50+
private String tagValue;
51+
}

griffin-metric/src/main/java/org/apache/griffin/metric/model/MetricV.java

+20-6
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ Licensed to the Apache Software Foundation (ASF) under one
1818
*/
1919
package org.apache.griffin.metric.model;
2020

21-
import lombok.*;
22-
23-
import java.util.Map;
24-
21+
import lombok.AllArgsConstructor;
22+
import lombok.Builder;
23+
import lombok.Data;
24+
import lombok.EqualsAndHashCode;
25+
import lombok.NoArgsConstructor;
26+
import lombok.ToString;
27+
28+
/**
29+
* A metric value entity represents fundamental information.
30+
*/
2531
@Data
2632
@ToString
2733
@Builder
@@ -30,10 +36,18 @@ Licensed to the Apache Software Foundation (ASF) under one
3036
@EqualsAndHashCode(callSuper = false)
3137
public class MetricV extends BaseEntity {
3238

39+
/**
40+
* An unique identity for a metric.
41+
*/
3342
private long metricId;
3443

44+
/**
45+
* A double number to store metric value.
46+
*/
3547
private double value;
3648

37-
private Map<String, String> tags;
38-
49+
/**
50+
* The tag property assigned.
51+
*/
52+
private Tags tags;
3953
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package org.apache.griffin.metric.model;
2+
3+
import lombok.AllArgsConstructor;
4+
import lombok.Builder;
5+
import lombok.Data;
6+
import lombok.EqualsAndHashCode;
7+
import lombok.NoArgsConstructor;
8+
9+
import java.util.List;
10+
11+
/**
12+
* A common tag entity represents the relationships among metric entities and metric tag entities.
13+
*/
14+
@Data
15+
@Builder
16+
@NoArgsConstructor
17+
@AllArgsConstructor
18+
@EqualsAndHashCode(callSuper = false)
19+
public class Tags extends BaseEntity {
20+
21+
/**
22+
* Metric entity's identity.
23+
*/
24+
private long metricId;
25+
26+
/**
27+
* All tag properties assigning to a metric entity.
28+
*/
29+
private List<MetricTag> metricTags;
30+
}

0 commit comments

Comments
 (0)