Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workload intensity slider to the dashboard UI #483

Merged
merged 8 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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