Kill Actor UI addition (#6955)

This commit is contained in:
ijrsvt
2020-01-29 14:32:19 -08:00
committed by GitHub
parent c2be794f10
commit ff706660d2
2 changed files with 27 additions and 1 deletions
+11
View File
@@ -178,3 +178,14 @@ export const getProfilingResultURL = (profilingId: string) =>
`${base}/speedscope/index.html#profileURL=${encodeURIComponent(
`${base}/api/get_profiling_info?profiling_id=${profilingId}`
)}`;
export const launchKillActor = (
actorId: string,
actorIpAddress: string,
actorPort: number
) =>
get<string>("/api/kill_actor", {
actor_id: actorId,
ip_address: actorIpAddress,
port: actorPort
});
@@ -8,7 +8,8 @@ import {
CheckProfilingStatusResponse,
getProfilingResultURL,
launchProfiling,
RayletInfoResponse
RayletInfoResponse,
launchKillActor
} from "../../../api";
import Actors from "./Actors";
import Collapse from "@material-ui/core/Collapse";
@@ -110,6 +111,13 @@ class Actor extends React.Component<Props & WithStyles<typeof styles>, State> {
}
};
killActor = () => {
const actor = this.props.actor;
if (actor.state === 0) {
launchKillActor(actor.actorId, actor.ipAddress, actor.port);
}
};
render() {
const { classes, actor } = this.props;
const { expanded, profiling } = this.state;
@@ -242,6 +250,13 @@ class Actor extends React.Component<Props & WithStyles<typeof styles>, State> {
</React.Fragment>
))}
){" "}
{actor.state === 0 ? (
<span className={classes.action} onClick={this.killActor}>
Kill Actor
</span>
) : (
""
)}
{Object.entries(profiling).map(
([profilingId, { startTime, latestResponse }]) =>
latestResponse !== null && (