Skip to content

Commit

Permalink
Add missing management.metrics.export.wavefront properties
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Jul 21, 2023
1 parent cb5c506 commit df033ef
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,6 +57,21 @@ public class WavefrontProperties extends PushRegistryProperties {
*/
private String globalPrefix;

/**
* Whether to report histogram distributions aggregated into minute intervals.
*/
private boolean reportMinuteDistribution = true;

/**
* Whether to report histogram distributions aggregated into hour intervals.
*/
private boolean reportHourDistribution = false;

/**
* Whether to report histogram distributions aggregated into day intervals.
*/
private boolean reportDayDistribution = false;

private final Sender sender = new Sender();

public URI getUri() {
Expand Down Expand Up @@ -95,6 +110,30 @@ public Sender getSender() {
return this.sender;
}

public boolean isReportMinuteDistribution() {
return this.reportMinuteDistribution;
}

public void setReportMinuteDistribution(boolean reportMinuteDistribution) {
this.reportMinuteDistribution = reportMinuteDistribution;
}

public boolean isReportHourDistribution() {
return this.reportHourDistribution;
}

public void setReportHourDistribution(boolean reportHourDistribution) {
this.reportHourDistribution = reportHourDistribution;
}

public boolean isReportDayDistribution() {
return this.reportDayDistribution;
}

public void setReportDayDistribution(boolean reportDayDistribution) {
this.reportDayDistribution = reportDayDistribution;
}

public static class Sender {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2020 the original author or authors.
* Copyright 2012-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,6 +63,21 @@ public String globalPrefix() {
return get(WavefrontProperties::getGlobalPrefix, WavefrontConfig.super::globalPrefix);
}

@Override
public boolean reportMinuteDistribution() {
return get(WavefrontProperties::isReportMinuteDistribution, WavefrontConfig.super::reportMinuteDistribution);
}

@Override
public boolean reportHourDistribution() {
return get(WavefrontProperties::isReportHourDistribution, WavefrontConfig.super::reportHourDistribution);
}

@Override
public boolean reportDayDistribution() {
return get(WavefrontProperties::isReportDayDistribution, WavefrontConfig.super::reportDayDistribution);
}

private String getUriAsString(WavefrontProperties properties) {
return (properties.getUri() != null) ? properties.getUri().toString() : null;
}
Expand Down

0 comments on commit df033ef

Please sign in to comment.