Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize: some typos #2120

Merged
merged 2 commits into from
Jan 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public enum ExporterType {
/**
* Export metrics data to Prometheus
*/
Prometheus;
PROMETHEUS;

public static ExporterType getType(String name) {
if (Prometheus.name().equalsIgnoreCase(name)) {
return Prometheus;
if (PROMETHEUS.name().equalsIgnoreCase(name)) {
return PROMETHEUS;
} else {
throw new NotSupportYetException("unsupported type:" + name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public enum RegistryType {
/**
* Built-in compact metrics registry
*/
Compact;
COMPACT;

public static RegistryType getType(String name) {
if (Compact.name().equalsIgnoreCase(name)) {
return Compact;
if (COMPACT.name().equalsIgnoreCase(name)) {
return COMPACT;
} else {
throw new NotSupportYetException("unsupported type:" + name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public List<MetricFamilySamples> collect() {
List<Sample> samples = new ArrayList<>();
measurements.forEach(measurement -> samples.add(convertMeasurementToSample(measurement)));

if (samples.size() != 0) {
if (!samples.isEmpty()) {
familySamples.add(new MetricFamilySamples("seata", Type.UNTYPED, "seata", samples));
}
}
Expand Down