Skip to content

Commit 7d60489

Browse files
committed
chore(controller): measurements uses lowercase letters
1 parent 8cc1e11 commit 7d60489

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

rootfs/api/management/commands/measure_networks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def _measure_networks(self, config_map, timestamp):
2525
"app_id": app_id,
2626
"owner_id": owner_id,
2727
"name": record["pod_name"],
28-
"type": "NETWORK",
29-
"unit": "BYTES",
28+
"type": "network",
29+
"unit": "bytes",
3030
"usage": record["rx_bytes"] + record["tx_bytes"],
3131
"timestamp": "%d" % start
3232
})

rootfs/api/models/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,17 +1214,17 @@ def to_measurements(self, timestamp: float):
12141214
"app_id": self.id,
12151215
"user_id": self.owner_id,
12161216
"name": container_type,
1217-
"type": "CPU",
1218-
"unit": "MILLI",
1217+
"type": "cpu",
1218+
"unit": "milli",
12191219
"usage": unit_to_millicpu(config.cpu.get(container_type)) * scale,
12201220
"timestamp": "%f" % timestamp
12211221
})
12221222
measurements.append({
12231223
"app_id": self.app_id,
12241224
"user_id": self.owner_id,
12251225
"name": container_type,
1226-
"type": "MEMORY",
1227-
"unit": "BYTES",
1226+
"type": "memory",
1227+
"unit": "bytes",
12281228
"usage": unit_to_bytes(config.memory.get(container_type)) * scale,
12291229
"timestamp": "%f" % timestamp
12301230
})

rootfs/api/models/volume.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ def to_measurements(self, timestamp: float):
9797
"app_id": str(self.app_id),
9898
"user_id": str(self.owner_id),
9999
"name": self.name,
100-
"type": "VOLUME",
101-
"unit": "BYTES",
100+
"type": "volume",
101+
"unit": "bytes",
102102
"usage": unit_to_bytes(self.size),
103103
"timestamp": "%f" % timestamp
104104
}]

0 commit comments

Comments
 (0)