File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
plugins/plugin-codeflare-dashboard/src/controller Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -34,17 +34,25 @@ function usage() {
3434 return dbUsage ( "dump" ) + " [-f/--follow]"
3535}
3636
37+ /** Dump raw info, rather than nicely formatted into a dashboard */
3738export default async function dump ( args : Arguments < Options > ) {
39+ // what kind of data are we being asked to show
3840 const kind = args . argvNoOptions [ args . argvNoOptions . indexOf ( "dump" ) + 1 ]
41+
42+ // and for which jobId and profile?
3943 const { jobId, profile } = await jobIdFrom ( args , "dump" )
4044
41- if ( ! isValidKind ( kind ) ) {
45+ if ( ! ( isValidKind ( kind ) || kind === "path" ) ) {
4246 throw new Error ( usage ( ) )
4347 } else if ( ! jobId ) {
4448 throw new Error ( usage ( ) )
4549 }
4650
47- if ( ! args . parsedOptions . f ) {
51+ if ( kind === "path" ) {
52+ // print the path to the data captured for the given jobId in the given profile
53+ const { dirname } = await import ( "path" )
54+ return Array . from ( new Set ( await pathsFor ( "cpu" , profile , jobId ) . then ( ( _ ) => _ . map ( ( _ ) => dirname ( _ ) ) ) ) ) [ 0 ]
55+ } else if ( ! args . parsedOptions . f ) {
4856 const { createReadStream } = await import ( "fs" )
4957 await Promise . all (
5058 (
You can’t perform that action at this time.
0 commit comments