Commit 4e64224c authored by Hines, Jesse's avatar Hines, Jesse
Browse files

Rename cdu.xname to cdu.name

parent 2468b9f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
            "dimensionsSpec": {
                "dimensions": [
                    "sim_id",
                    "xname",
                    "name",
                    {
                        "type": "long",
                        "name": "row"
+2 −3
Original line number Diff line number Diff line
@@ -134,10 +134,9 @@ class SchedulerSimSystem(BaseModel):

class CoolingSimCDU(BaseModel):
    timestamp: AwareDatetime
    xname: Optional[str] = None
    name: Optional[str] = None
    """
    Unique identifier for the CDU of the (simulated) measurement, e.g. x2007c1.
    The CDU xname is the xname of the neighboring cabinet.
    """
    row: Optional[int] = None
    """ Row index of the CDU """
@@ -168,7 +167,7 @@ class CoolingSimCDU(BaseModel):


COOLING_CDU_API_FIELDS = {
    "xname": 'string',
    "name": 'string',
    "row": 'number',
    "col": 'number',
    "rack_1_power": 'number',
+1 −1
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ class SchedulerSimConfig(BaseModel):
    """

    enabled: bool = False
    down_nodes: list[int] = [] # List of hostnames. TODO: allow parsing from xnames/hostname or int maybe?
    down_nodes: list[int] = [] # List of hostnames. TODO: allow parsing from xnames
    
    jobs_mode: Literal['replay', 'custom', 'random', 'test'] = 'random'
    schedule_policy: Literal['fcfs', 'sjf', 'prq'] ='fcfs'
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ cooling_sim_cdu = Table(
    metadata,
    Column("__time", TIMESTAMP),
    Column("sim_id", String),
    Column("xname", String),
    Column("name", String),
    Column("row", Integer),
    Column("col", Integer),
    Column("rack_1_power", Double),
+2 −2
Original line number Diff line number Diff line
@@ -416,12 +416,12 @@ def build_cooling_sim_cdu_query(*,
    tbl = orm.cooling_sim_cdu.alias("cdus")
    filter_cols = {c: tbl.c[c] for c in COOLING_CDU_API_FIELDS}
    group_cols = {
        "xname": tbl.c['xname'],
        "name": tbl.c['name'],
    }
    agg_cols: dict[str, sqla.sql.ColumnElement] = {
        **{
            c: sqla.func.max(tbl.c[c]) for c in COOLING_CDU_API_FIELDS
            if c not in ['xname', 'row', 'col']
            if c not in ['name', 'row', 'col']
        },
        **{c: sqla.func.any_value(tbl.c[c]) for c in ['row', 'col']},
    }
Loading