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

Adding toggle that enables reveal based aggregation #77

Merged
merged 4 commits into from
Aug 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
27 changes: 27 additions & 0 deletions server/app/query/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ function IPAForm({
const [stallDetectionEnabled, setStallDetectionEnabled] = useState(true);
const [multiThreadingEnabled, setMultiThreadingEnabled] = useState(true);
const [disableMetricsEnabled, setDisableMetricsEnabled] = useState(false);
const [revealAggregationEnabled, setRevealAggregationEnabled] = useState(false);
const disableBranch = commitSpecifier != CommitSpecifier.BRANCH;
const disableCommitHash = commitSpecifier != CommitSpecifier.COMMIT_HASH;
const filteredCommitHashes =
Expand Down Expand Up @@ -435,6 +436,32 @@ function IPAForm({
</div>
</div>

<div className="items-center pt-4">
<div className="block text-sm font-medium leading-6 text-gray-900">
Use Breakdown Reveal Aggregation
</div>
<div className="block pt-1 text-sm font-medium leading-6 text-gray-900">
<Switch
checked={revealAggregationEnabled}
onChange={setRevealAggregationEnabled}
className={`${
revealAggregationEnabled ? "bg-blue-600" : "bg-gray-200"
} relative inline-flex size-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`}
>
<span
className={`${
revealAggregationEnabled ? "translate-x-6" : "translate-x-1"
} inline-block size-4 rounded-full bg-white transition-transform`}
/>
</Switch>
<input
type="hidden"
name="reveal_aggregation"
value={revealAggregationEnabled.toString()}
/>
</div>
</div>

<button
type="submit"
className={clsx(
Expand Down
5 changes: 5 additions & 0 deletions sidecar/app/query/ipa.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class IPAHelperCompileStep(LoggerOutputCommandStep):
stall_detection: bool
multi_threading: bool
disable_metrics: bool
reveal_aggregation: bool
logger: loguru.Logger = field(repr=False)
status: ClassVar[Status] = Status.COMPILING

Expand All @@ -176,13 +177,15 @@ def build_from_query(cls, query: IPAHelperQuery):
stall_detection = query.stall_detection
multi_threading = query.multi_threading
disable_metrics = query.disable_metrics
reveal_aggregation = query.reveal_aggregation
return cls(
manifest_path=manifest_path,
target_path=query.paths.target_path,
gate_type=gate_type,
stall_detection=stall_detection,
multi_threading=multi_threading,
disable_metrics=disable_metrics,
reveal_aggregation=reveal_aggregation,
logger=query.logger,
)

Expand All @@ -192,6 +195,7 @@ def build_command(self) -> LoggerOutputCommand:
f'--features="web-app real-world-infra {self.gate_type}'
f"{' stall-detection' if self.stall_detection else ''}"
f"{' multi-threading' if self.multi_threading else ''}"
f"{' reveal-aggregation' if self.reveal_aggregation else ''}"
f"{' disable-metrics' if self.disable_metrics else ''}\" "
f"--no-default-features --target-dir={self.target_path} "
f"--release",
Expand Down Expand Up @@ -410,6 +414,7 @@ class IPAHelperQuery(IPAQuery):
stall_detection: bool
multi_threading: bool
disable_metrics: bool
reveal_aggregation: bool

step_classes: ClassVar[list[type[Step]]] = [
IPACloneStep,
Expand Down
3 changes: 3 additions & 0 deletions sidecar/app/routes/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def start_ipa_helper(
stall_detection: Annotated[bool, Form()],
multi_threading: Annotated[bool, Form()],
disable_metrics: Annotated[bool, Form()],
reveal_aggregation: Annotated[bool, Form()],
background_tasks: BackgroundTasks,
request: Request,
):
Expand All @@ -88,6 +89,7 @@ def start_ipa_helper(
f"{'_stall-detection' if stall_detection else ''}"
f"{'_multi-threading' if multi_threading else ''}"
f"{'_disable-metrics' if disable_metrics else ''}"
f"{'_reveal-aggregation' if reveal_aggregation else ''}"
)

paths = Paths(
Expand All @@ -103,6 +105,7 @@ def start_ipa_helper(
stall_detection=stall_detection,
multi_threading=multi_threading,
disable_metrics=disable_metrics,
reveal_aggregation=reveal_aggregation,
port=settings.helper_port,
)
background_tasks.add_task(query_manager.run_query, query)
Expand Down
Loading