Skip to content

Commit

Permalink
Add workload intensity slider to the dashboard UI (#483)
Browse files Browse the repository at this point in the history
* Add System Config component

* Make system config a modal

* Remove unneeded config

* Add workload adjuster component

* Add workload adjuster component

* Make workload controller toggle

* Formatting

* Adjust ports
  • Loading branch information
geoffxy authored Mar 30, 2024
1 parent 7666acc commit 1c6c8d6
Show file tree
Hide file tree
Showing 13 changed files with 898 additions and 41 deletions.
22 changes: 22 additions & 0 deletions src/brad/ui/manager_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from typing import Optional, List
from pydantic import BaseModel

import brad.ui.static as brad_app
from brad.blueprint import Blueprint
Expand Down Expand Up @@ -173,6 +174,27 @@ def get_system_state(filter_tables_for_demo: bool = False) -> SystemState:
return system_state


class ClientState(BaseModel):
max_clients: int
curr_clients: int


class SetClientState(BaseModel):
curr_clients: int


@app.get("/clients")
def get_clients_dummy() -> ClientState:
# Used for debugging without starting the variable client runner.
return ClientState(max_clients=12, curr_clients=3)


@app.post("/clients")
def set_clients_dummy(clients: SetClientState) -> ClientState:
# Used for debugging without starting the variable client runner.
return ClientState(max_clients=12, curr_clients=clients.curr_clients)


def _analytics_table_mapper_temp(table_name: str, blueprint: Blueprint) -> List[str]:
# TODO: This is a hard-coded heurstic for the mock up only.
locations = blueprint.get_table_locations(table_name)
Expand Down
Loading

0 comments on commit 1c6c8d6

Please sign in to comment.