-
Notifications
You must be signed in to change notification settings - Fork 990
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework Micrometer export configuration properties classes (fixes #113)
- Loading branch information
1 parent
6834b0a
commit 258d804
Showing
20 changed files
with
880 additions
and
163 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
80 changes: 80 additions & 0 deletions
80
...cy/src/main/java/io/micrometer/spring/autoconfigure/export/DefaultStepRegistryConfig.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,80 @@ | ||
/** | ||
* Copyright 2017 Pivotal Software, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micrometer.spring.autoconfigure.export; | ||
|
||
import io.micrometer.core.instrument.spectator.step.StepRegistryConfig; | ||
|
||
import java.time.Duration; | ||
|
||
public abstract class DefaultStepRegistryConfig implements StepRegistryConfig { | ||
private final StepRegistryProperties props; | ||
|
||
private final StepRegistryConfig defaults = new StepRegistryConfig() { | ||
@Override | ||
public String prefix() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String get(String k) { | ||
return null; | ||
} | ||
}; | ||
|
||
public DefaultStepRegistryConfig(StepRegistryProperties props) { | ||
this.props = props; | ||
} | ||
|
||
@Override | ||
public String prefix() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String get(String k) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public Duration step() { | ||
return props.getStep(); | ||
} | ||
|
||
@Override | ||
public boolean enabled() { | ||
return props.getEnabled(); | ||
} | ||
|
||
@Override | ||
public Duration connectTimeout() { | ||
return props.getConnectTimeout() == null ? defaults.connectTimeout() : props.getConnectTimeout(); | ||
} | ||
|
||
@Override | ||
public Duration readTimeout() { | ||
return props.getReadTimeout() == null ? defaults.readTimeout() : props.getReadTimeout(); | ||
} | ||
|
||
@Override | ||
public int numThreads() { | ||
return props.getNumThreads() == null ? defaults.numThreads() : props.getNumThreads(); | ||
} | ||
|
||
@Override | ||
public int batchSize() { | ||
return props.getBatchSize() == null ? defaults.batchSize() : props.getBatchSize(); | ||
} | ||
} |
42 changes: 0 additions & 42 deletions
42
...ng-legacy/src/main/java/io/micrometer/spring/autoconfigure/export/RegistryProperties.java
This file was deleted.
Oops, something went wrong.
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.