Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tracing to model translator generation #638

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Conversation

saifc
Copy link
Collaborator

@saifc saifc commented Nov 15, 2023

This follows the other parts of the plugin by adding tracing to the model translator generation.

@@ -34,14 +39,35 @@ class GenerateTranslatorBodyAction(private val bundle: TranslatorBundle) : Inten
override fun startInWriteAction() = true

override fun invoke(project: Project, editor: Editor?, psiFile: PsiFile?) {
val startTimestamp = Instant.now()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting measurement here to know how long it takes for the generation to happen.
I noticed that in other parts of the plugin, this is created as a field with the action creation as part of the annotation process, is that on purpose for some reason?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's intentional for the WhatsNewPanelListener because I want to measure the session time when the window was initially hidden (the listener is created) and then opened.

For the other parts, I should change them similarly to this PR :). I wasn't particularly interested in tracking the duration for ProjectGen & FeatureFlag Annotation then.

@saifc saifc requested review from linhpha and ZacSweers November 15, 2023 17:44
@saifc saifc marked this pull request as ready for review November 15, 2023 17:49
@saifc saifc added this pull request to the merge queue Nov 15, 2023
Merged via the queue into main with commit 2348cb9 Nov 15, 2023
@saifc saifc deleted the sc_model_translator_tracing branch November 15, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants