-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add detailed diagram loader initialize measurements
- Loading branch information
Showing
3 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Disposable, GLSPClient, GLSPModelSource } from '@eclipse-glsp/client'; | ||
import { injectable } from 'inversify'; | ||
|
||
@injectable() | ||
export class PerfGLSPModelSource extends GLSPModelSource { | ||
async configure(glspClient: GLSPClient): Promise<void> { | ||
console.time('GLSPModelSource.configure (MS)'); | ||
this.glspClient = glspClient; | ||
if (!glspClient.initializeResult) { | ||
throw new Error('Could not configure model source. The GLSP client is not initialized yet!'); | ||
} | ||
|
||
console.time('createInitializeClientSessionParameters (MS)'); | ||
const initializeParams = this.createInitializeClientSessionParameters(glspClient.initializeResult); | ||
console.timeEnd('createInitializeClientSessionParameters (MS)'); | ||
|
||
console.time('configureServerActions (MS)'); | ||
this.configureServeActions(glspClient.initializeResult); | ||
console.timeEnd('configureServerActions (MS)'); | ||
|
||
this.toDispose.push( | ||
glspClient.onActionMessage(message => this.messageReceived(message), this.clientId), | ||
Disposable.create(() => glspClient.disposeClientSession(this.createDisposeClientSessionParameters())) | ||
); | ||
|
||
console.time('initializeClientSession (MS)'); | ||
const result = await glspClient!.initializeClientSession(initializeParams); | ||
console.timeEnd('initializeClientSession (MS)'); | ||
console.timeEnd('GLSPModelSource.configure (MS)'); | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters