-
Notifications
You must be signed in to change notification settings - Fork 210
/
SubscriptionMetrics.java
177 lines (143 loc) · 4.73 KB
/
SubscriptionMetrics.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package pl.allegro.tech.hermes.api;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SubscriptionMetrics {
private long delivered;
private long discarded;
private long inflight;
private String timeouts;
private String otherErrors;
private String codes2xx;
private String codes4xx;
private String codes5xx;
private long lag;
private Subscription.State state;
private String rate;
private String throughput;
private String batchRate;
private SubscriptionMetrics() {
}
@JsonCreator
public SubscriptionMetrics(@JsonProperty("delivered") long delivered, @JsonProperty("discarded") long discarded,
@JsonProperty("inflight") long inflight, @JsonProperty("timeouts") String timeouts,
@JsonProperty("otherErrors") String otherErrors, @JsonProperty("codes2xx") String codes2xx,
@JsonProperty("codes4xx") String codes4xx, @JsonProperty("codes5xx") String codes5xx,
@JsonProperty("Subscription") Subscription.State state, @JsonProperty("rate") String rate,
@JsonProperty("throughput") String throughput, @JsonProperty("batchRate") String batchRate) {
this.delivered = delivered;
this.discarded = discarded;
this.inflight = inflight;
this.timeouts = timeouts;
this.otherErrors = otherErrors;
this.codes2xx = codes2xx;
this.codes4xx = codes4xx;
this.codes5xx = codes5xx;
this.state = state;
this.rate = rate;
this.throughput = throughput;
this.batchRate = batchRate;
}
public long getDelivered() {
return delivered;
}
public long getDiscarded() {
return discarded;
}
public long getInflight() {
return inflight;
}
public String getTimeouts() {
return timeouts;
}
public long getLag() {
return lag;
}
public String getRate() {
return rate;
}
public String getOtherErrors() {
return otherErrors;
}
public String getCodes2xx() {
return codes2xx;
}
public String getCodes4xx() {
return codes4xx;
}
public String getCodes5xx() {
return codes5xx;
}
public Subscription.State getState() {
return state;
}
public String getThroughput() {
return throughput;
}
public String getBatchRate() {
return batchRate;
}
public static class Builder {
private SubscriptionMetrics subscriptionMetrics;
public Builder() {
subscriptionMetrics = new SubscriptionMetrics();
}
public Builder withDelivered(long delivered) {
subscriptionMetrics.delivered = delivered;
return this;
}
public Builder withDiscarded(long discarded) {
subscriptionMetrics.discarded = discarded;
return this;
}
public Builder withInflight(long inflight) {
subscriptionMetrics.inflight = inflight;
return this;
}
public Builder withOtherErrors(String otherErrors) {
subscriptionMetrics.otherErrors = otherErrors;
return this;
}
public Builder withTimeouts(String timeouts) {
subscriptionMetrics.timeouts = timeouts;
return this;
}
public Builder withCodes2xx(String count) {
subscriptionMetrics.codes2xx = count;
return this;
}
public Builder withCodes4xx(String count) {
subscriptionMetrics.codes4xx = count;
return this;
}
public Builder withCodes5xx(String count) {
subscriptionMetrics.codes5xx = count;
return this;
}
public Builder withRate(String rate) {
subscriptionMetrics.rate = rate;
return this;
}
public Builder withState(Subscription.State state) {
subscriptionMetrics.state = state;
return this;
}
public Builder withLag(long lag) {
subscriptionMetrics.lag = lag;
return this;
}
public Builder withThroughput(String throughput) {
subscriptionMetrics.throughput = throughput;
return this;
}
public Builder withBatchRate(String batchRate) {
subscriptionMetrics.batchRate = batchRate;
return this;
}
public static Builder subscriptionMetrics() {
return new Builder();
}
public SubscriptionMetrics build() {
return subscriptionMetrics;
}
}
}