forked from nzymedefense/nzyme
-
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.
- Loading branch information
1 parent
4a92924
commit 4815d97
Showing
6 changed files
with
320 additions
and
15 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
49 changes: 49 additions & 0 deletions
49
src/main/java/horse/wtf/nzyme/rest/resources/taps/reports/BusReport.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,49 @@ | ||
/* | ||
* This file is part of nzyme. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
|
||
package horse.wtf.nzyme.rest.resources.taps.reports; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.auto.value.AutoValue; | ||
|
||
import java.util.List; | ||
|
||
@AutoValue | ||
public abstract class BusReport { | ||
|
||
public abstract List<ChannelReport> channels(); | ||
|
||
@JsonCreator | ||
public static BusReport create(@JsonProperty("channels") List<ChannelReport> channels) { | ||
return builder() | ||
.channels(channels) | ||
.build(); | ||
} | ||
|
||
public static Builder builder() { | ||
return new AutoValue_BusReport.Builder(); | ||
} | ||
|
||
@AutoValue.Builder | ||
public abstract static class Builder { | ||
public abstract Builder channels(List<ChannelReport> channels); | ||
|
||
public abstract BusReport build(); | ||
} | ||
|
||
} |
71 changes: 71 additions & 0 deletions
71
src/main/java/horse/wtf/nzyme/rest/resources/taps/reports/ChannelReport.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 @@ | ||
/* | ||
* This file is part of nzyme. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
|
||
package horse.wtf.nzyme.rest.resources.taps.reports; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.auto.value.AutoValue; | ||
|
||
@AutoValue | ||
public abstract class ChannelReport { | ||
|
||
public abstract String name(); | ||
public abstract Long capacity(); | ||
public abstract Long watermark(); | ||
public abstract TotalWithAverage errors(); | ||
public abstract TotalWithAverage throughputBytes(); | ||
public abstract TotalWithAverage throughputMessages(); | ||
|
||
@JsonCreator | ||
public static ChannelReport create(@JsonProperty("name") String name, | ||
@JsonProperty("capacity") Long capacity, | ||
@JsonProperty("watermark") Long watermark, | ||
@JsonProperty("errors") TotalWithAverage errors, | ||
@JsonProperty("throughput_bytes") TotalWithAverage throughputBytes, | ||
@JsonProperty("throughput_messages") TotalWithAverage throughputMessages) { | ||
return builder() | ||
.name(name) | ||
.capacity(capacity) | ||
.watermark(watermark) | ||
.errors(errors) | ||
.throughputBytes(throughputBytes) | ||
.throughputMessages(throughputMessages) | ||
.build(); | ||
} | ||
|
||
public static Builder builder() { | ||
return new AutoValue_ChannelReport.Builder(); | ||
} | ||
|
||
@AutoValue.Builder | ||
public abstract static class Builder { | ||
public abstract Builder name(String name); | ||
|
||
public abstract Builder capacity(Long capacity); | ||
|
||
public abstract Builder watermark(Long watermark); | ||
|
||
public abstract Builder errors(TotalWithAverage errors); | ||
|
||
public abstract Builder throughputBytes(TotalWithAverage throughputBytes); | ||
|
||
public abstract Builder throughputMessages(TotalWithAverage throughputMessages); | ||
|
||
public abstract ChannelReport build(); | ||
} | ||
} |
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.