org.graylog2.telemetry.dto.NodeStats 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.plugin.lifecycles.Lifecycle;
import org.graylog2.plugin.lifecycles.LoadBalancerStatus;
import javax.validation.constraints.NotNull;
@AutoValue
@JsonAutoDetect
public abstract class NodeStats {
@JsonProperty
public abstract Lifecycle lifecycle();
@JsonProperty
public abstract boolean processing();
@JsonProperty
public abstract LoadBalancerStatus loadBalancerStatus();
@JsonProperty
public abstract long inputCount();
public static NodeStats create(@NotNull final Lifecycle lifecycle,
final boolean processing,
@NotNull final LoadBalancerStatus loadBalancerStatus,
long inputCount) {
return new AutoValue_NodeStats(lifecycle, processing, loadBalancerStatus, inputCount);
}
}