All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.graylog2.telemetry.dto.ClusterDataSet Maven / Gradle / Ivy

package org.graylog2.telemetry.dto;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.auto.value.AutoValue;
import org.graylog2.system.stats.ClusterStats;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Map;

@AutoValue
@JsonAutoDetect
public abstract class ClusterDataSet {
    @JsonProperty
    public abstract String version();

    @JsonProperty
    public abstract long timestamp();

    @JsonProperty
    public abstract long reportIntervalMs();

    @JsonProperty
    public abstract long totalMessages();

    @JsonProperty
    public abstract long globalThroughput();

    @JsonProperty
    public abstract Map streamThroughput();

    @JsonProperty
    public abstract ClusterStats clusterStats();

    public static ClusterDataSet create(@NotEmpty String version,
                                        @Min(0) long timestamp,
                                        @Min(0) long reportIntervalMs,
                                        @Min(0) final long totalMessages,
                                        @Min(0) final long globalThroughput,
                                        @NotNull final Map streamThroughput,
                                        @Valid ClusterStats clusterStats) {
        return new AutoValue_ClusterDataSet(version, timestamp, reportIntervalMs, totalMessages, globalThroughput, streamThroughput, clusterStats);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy