github.com/grafana/pyroscope@v1.18.0/public/app/hooks/util/determineDefaultApp.ts (about) 1 // Async to support override in Grafana's app plugin 2 export async function determineDefaultApp(apps: any[]) { 3 const cpuApp = apps.find( 4 (app) => app.__profile_type__.split(':')[1] === 'cpu' 5 ); 6 7 if (cpuApp) { 8 return cpuApp; 9 } 10 11 // `.itimer` type for Java 12 const itimerApp = apps.find( 13 (app) => app.__profile_type__.split(':')[1] === '.itimer' 14 ); 15 16 if (itimerApp) { 17 return itimerApp; 18 } 19 20 return apps[0]; 21 }