forked from BLC/sgeUpdated
Fix message queue data misnaming
This commit is contained in:
@@ -17,10 +17,10 @@ public class DataCenterDto {
|
|||||||
private Integer externalId;
|
private Integer externalId;
|
||||||
private Integer number;
|
private Integer number;
|
||||||
private AreaDto area;
|
private AreaDto area;
|
||||||
|
|
||||||
@JsonProperty("physical_machine")
|
@JsonProperty("physical_machines")
|
||||||
private Map<String, PhysicalMachineDto> physicalMachine;
|
private Map<String, PhysicalMachineDto> physicalMachine;
|
||||||
|
|
||||||
// Emission calculation fields
|
// Emission calculation fields
|
||||||
private SectorDto sector;
|
private SectorDto sector;
|
||||||
private SubSectorDto subSector;
|
private SubSectorDto subSector;
|
||||||
@@ -62,12 +62,12 @@ public class DataCenterDto {
|
|||||||
this.number = number;
|
this.number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AreaDto getArea() {
|
public AreaDto getArea() {
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setArea(AreaDto area) {
|
public void setArea(AreaDto area) {
|
||||||
this.area = area;
|
this.area = area;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, PhysicalMachineDto> getPhysicalMachine() {
|
public Map<String, PhysicalMachineDto> getPhysicalMachine() {
|
||||||
|
|||||||
@@ -805,10 +805,19 @@ public class MessageListener {
|
|||||||
input.setVmId(vm.getId());
|
input.setVmId(vm.getId());
|
||||||
System.out.println("🔍 Setting VM ID: " + vm.getId());
|
System.out.println("🔍 Setting VM ID: " + vm.getId());
|
||||||
|
|
||||||
// Use the source-specific power consumption (percentage of total VM power)
|
// Use the source-specific power consumption (percentage of total VM power)
|
||||||
input.setConsuptionAmount(String.valueOf(sourceSpecificPower));
|
// Format to 6 decimal places to avoid very long strings
|
||||||
System.out.println("🔍 Setting Consumption Amount: " + sourceSpecificPower + "W");
|
String formattedPower = String.format("%.6f", sourceSpecificPower);
|
||||||
|
input.setConsuptionAmount(formattedPower);
|
||||||
|
System.out.println("🔍 Setting Consumption Amount: " + formattedPower + "W");
|
||||||
|
|
||||||
|
// Validate field lengths to prevent database errors
|
||||||
|
System.out.println("🔍 Field length validation:");
|
||||||
|
System.out.println(" Year: " + (input.getYear() != null ? input.getYear().length() : "null"));
|
||||||
|
System.out.println(" Month: " + (input.getMonth() != null ? input.getMonth().length() : "null"));
|
||||||
|
System.out.println(" ConsuptionAmount: " + (input.getConsuptionAmount() != null ? input.getConsuptionAmount().length() : "null"));
|
||||||
|
|
||||||
|
|
||||||
System.out.println("🔍 VM Emission Input for Source:");
|
System.out.println("🔍 VM Emission Input for Source:");
|
||||||
System.out.println(" VM ID: " + vm.getId());
|
System.out.println(" VM ID: " + vm.getId());
|
||||||
System.out.println(" VM Name: " + vm.getVmName());
|
System.out.println(" VM Name: " + vm.getVmName());
|
||||||
|
|||||||
Reference in New Issue
Block a user