Skip to content

Commit 633ebac

Browse files
author
Sina Kashipazha
committed
Fixed camel case issue.
1 parent fed9b6a commit 633ebac

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

plugins/integrations/prometheus/src/main/java/org/apache/cloudstack/metrics/PrometheusExporterImpl.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ private void addHostMetrics(final List<Item> metricsList, final long dcId, final
121121
int total = 0;
122122
int up = 0;
123123
int down = 0;
124-
Map<String, Integer> total_hosts = new HashMap<>();
125-
Map<String, Integer> up_hosts = new HashMap<>();
126-
Map<String, Integer> down_hosts = new HashMap<>();
124+
Map<String, Integer> totalHosts = new HashMap<>();
125+
Map<String, Integer> upHosts = new HashMap<>();
126+
Map<String, Integer> downHosts = new HashMap<>();
127127

128128
for (final HostVO host : hostDao.listAll()) {
129129
if (host == null || host.getType() != Host.Type.Routing || host.getDataCenterId() != dcId) {
@@ -144,18 +144,18 @@ private void addHostMetrics(final List<Item> metricsList, final long dcId, final
144144
List<String> hostTags = _hostTagsDao.gethostTags(host.getId());
145145
String hosttags = StringUtils.join(hostTags, ",");
146146
for (String tag : hostTags) {
147-
Integer current = total_hosts.get(tag) != null ? total_hosts.get(tag) : 0;
148-
total_hosts.put(tag, current + 1);
147+
Integer current = totalHosts.get(tag) != null ? totalHosts.get(tag) : 0;
148+
totalHosts.put(tag, current + 1);
149149
}
150150
if (host.getStatus() == Status.Up) {
151151
for (String tag : hostTags) {
152-
Integer current = up_hosts.get(tag) != null ? up_hosts.get(tag) : 0;
153-
up_hosts.put(tag, current + 1);
152+
Integer current = upHosts.get(tag) != null ? upHosts.get(tag) : 0;
153+
upHosts.put(tag, current + 1);
154154
}
155155
} else if (host.getStatus() == Status.Disconnected || host.getStatus() == Status.Down) {
156156
for (String tag : hostTags) {
157-
Integer current = down_hosts.get(tag) != null ? down_hosts.get(tag) : 0;
158-
down_hosts.put(tag, current + 1);
157+
Integer current = downHosts.get(tag) != null ? downHosts.get(tag) : 0;
158+
downHosts.put(tag, current + 1);
159159
}
160160
}
161161

@@ -219,22 +219,22 @@ private void addHostMetrics(final List<Item> metricsList, final long dcId, final
219219
metricsList.add(new ItemHost(zoneName, zoneUuid, ONLINE, up, null));
220220
metricsList.add(new ItemHost(zoneName, zoneUuid, OFFLINE, down, null));
221221
metricsList.add(new ItemHost(zoneName, zoneUuid, TOTAL, total, null));
222-
for (Map.Entry<String, Integer> entry : total_hosts.entrySet()) {
222+
for (Map.Entry<String, Integer> entry : totalHosts.entrySet()) {
223223
String tag = entry.getKey();
224224
Integer count = entry.getValue();
225225
metricsList.add(new ItemHost(zoneName, zoneUuid, TOTAL, count, tag));
226-
if (up_hosts.get(tag) != null) {
227-
metricsList.add(new ItemHost(zoneName, zoneUuid, ONLINE, up_hosts.get(tag), tag));
226+
if (upHosts.get(tag) != null) {
227+
metricsList.add(new ItemHost(zoneName, zoneUuid, ONLINE, upHosts.get(tag), tag));
228228
} else {
229229
metricsList.add(new ItemHost(zoneName, zoneUuid, ONLINE, 0, tag));
230230
}
231-
if (down_hosts.get(tag) != null) {
232-
metricsList.add(new ItemHost(zoneName, zoneUuid, OFFLINE, down_hosts.get(tag), tag));
231+
if (downHosts.get(tag) != null) {
232+
metricsList.add(new ItemHost(zoneName, zoneUuid, OFFLINE, downHosts.get(tag), tag));
233233
} else {
234234
metricsList.add(new ItemHost(zoneName, zoneUuid, OFFLINE, 0, tag));
235235
}
236236
}
237-
for (Map.Entry<String, Integer> entry : total_hosts.entrySet()) {
237+
for (Map.Entry<String, Integer> entry : totalHosts.entrySet()) {
238238
String tag = entry.getKey();
239239
Ternary<Long, Long, Long> allocatedCapacityByTag = capacityDao.findCapacityByZoneAndHostTag(dcId, tag);
240240
metricsList.add(new ItemVMCore(zoneName, zoneUuid, null, null, null, ALLOCATED, allocatedCapacityByTag.first(), 0, tag));

0 commit comments

Comments
 (0)