Skip to content

Commit

Permalink
Extend testing page with getting session performance data
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-koehler committed Jan 10, 2025
1 parent 420f9b8 commit f41e4e8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion node/testing-page/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
WorkspaceDeletionRequest,
WorkspaceListRequest,
PingRequest,
LaunchRequest
LaunchRequest,
SessionPerformanceRequest
} from '@eclipse-theiacloud/common';

const KEYCLOAK_CONFIG: KeycloakConfig = {
Expand Down Expand Up @@ -159,6 +160,14 @@ function App() {
};
return TheiaCloud.Session.stopSession(request, generateRequestOptions(accessToken));
};
const reportSessionPerformance = (user: string, accessToken?: string) => {
const request: SessionPerformanceRequest = {
appId: APP_ID,
sessionName: resourceName,
serviceUrl: SERVICE_URL
};
return TheiaCloud.Session.getSessionPerformance(request, generateRequestOptions(accessToken));
};

// App definition requests
const listAppDefinitions = (user: string, accessToken?: string) => {
Expand Down Expand Up @@ -197,6 +206,7 @@ function App() {
<button onClick={() => executeRequest(listSessions)}>List Sessions</button>
<button onClick={() => executeRequest(startSession)}>Start Session</button>
<button onClick={() => executeRequest(stopSession)}>Stop Session</button>
<button onClick={() => executeRequest(reportSessionPerformance)}>Report Session Performance</button>
</p>
<p>
<button onClick={() => executeRequest(listWorkspaces)}>List Workspaces</button>
Expand Down

0 comments on commit f41e4e8

Please sign in to comment.