Skip to content

Commit

Permalink
Adding toggle that enables reveal based aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
cberkhoff committed Aug 9, 2024
1 parent 8d88e01 commit f9ab853
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
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

0 comments on commit f9ab853

Please sign in to comment.