mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 17:37:07 +08:00
Kill Actor UI addition (#6955)
This commit is contained in:
@@ -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 && (
|
||||
|
||||
Reference in New Issue
Block a user