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

feat: Add PerformanceApi to SearchEngine #2720

Merged
merged 2 commits into from
Feb 7, 2025
Merged

feat: Add PerformanceApi to SearchEngine #2720

merged 2 commits into from
Feb 7, 2025

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Jan 29, 2025

We want to add some metrics to understand where time is consumed

All measurement are made through the PerformanceApi helper that can be injected from consuming app

Measurements have been added for the indexDocuments() duration (global and per doctype) and the search() duration

Related PR: cozy/cozy-client#1574

Base automatically changed from fix/searchengine_realtime_register_twice to master January 29, 2025 17:32
@Ldoppea Ldoppea force-pushed the feat/performances branch 2 times, most recently from 1e13480 to 2727210 Compare January 29, 2025 17:35
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Jan 29, 2025
In cozy/cozy-libs#2720 we added PerformanceAPI in the SearchEngine

This commit reflect the changes to the SearchEngine constructor

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Jan 29, 2025
In cozy/cozy-libs#2720 we added PerformanceAPI in the SearchEngine

This commit reflect the changes to the SearchEngine constructor

Related PR: cozy/cozy-libs#2720
this.client = client
this.searchIndexes = {} as SearchIndexes
this.performanceApi = performanceApi ?? defaultPerformanceApi
Copy link
Contributor

Choose a reason for hiding this comment

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

j'ai pas suivi pourquoi on importe 2 API et qu'on doit les charger toutes les 2 ? Est-ce que cozy-client ne devrait pas retourner un performanceOrDefaultApi par exemple qui porterait cette responsabilité ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Plus d'infos : https://github.com/cozy/cozy-client/blob/master/docs/performances.md

Est-ce que cozy-client ne devrait pas retourner un performanceOrDefaultApi

C'est le cas, cf L3. Mais tu peux vouloir une autre implem que celle par défaut, selon si tu es AA ou Web

Copy link
Contributor

@JF-Cozy JF-Cozy Feb 3, 2025

Choose a reason for hiding this comment

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

Ce n'est pas ça que j'avais pas compris, en fait j'ai mal lu on n'importe pas 2 API, le deuxième import est un type :) Et dans la condition la première vient des Props, et non de cozy-client

Copy link
Contributor

@paultranvan paultranvan left a comment

Choose a reason for hiding this comment

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

Some small remarks, but looks good!


this.performanceApi.measure({
markName: markName,
category: 'Search'
Copy link
Contributor

Choose a reason for hiding this comment

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

The 'search' category might be a bit misleading here, since we are indexing documents. Furthermore, this category name is reused later for the actual search

Copy link
Member Author

Choose a reason for hiding this comment

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

Would SearchEngine work better?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I didn't realized this category is used for the whole SeachEngine (indexing + search),so let's keep it like it

`cozy-client` has been upgraded to `53.1.0` in order to
retrieve typings for the Performance API

Related PR: cozy/cozy-client#1574
We want to add some metrics to understand where time is consumed

All measurement are made through the PerformanceApi helper that can be
injected from consuming app

Related PR: cozy/cozy-client#1574
@Ldoppea Ldoppea merged commit 4de7f27 into master Feb 7, 2025
2 checks passed
@Ldoppea Ldoppea deleted the feat/performances branch February 7, 2025 09:10
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 7, 2025
`cozy-dataproxy-lib` has been upgraded to `3.2.0` in order to retrieve
the new Performance API implementation

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 7, 2025
In cozy/cozy-libs#2720 we added PerformanceAPI in the SearchEngine

This commit reflect the changes to the SearchEngine constructor

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 7, 2025
`cozy-dataproxy-lib` has been upgraded to `3.2.0` in order to retrieve
the new Performance API implementation

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 7, 2025
In cozy/cozy-libs#2720 we added PerformanceAPI in the SearchEngine

This commit reflect the changes to the SearchEngine constructor

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 12, 2025
`cozy-dataproxy-lib` has been upgraded to `3.2.0` in order to retrieve
the new Performance API implementation

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 12, 2025
In cozy/cozy-libs#2720 we added PerformanceAPI in the SearchEngine

This commit reflect the changes to the SearchEngine constructor

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 12, 2025
`cozy-dataproxy-lib` has been upgraded to `3.2.0` in order to retrieve
the new Performance API implementation

Related PR: cozy/cozy-libs#2720
Ldoppea added a commit to cozy/cozy-flagship-app that referenced this pull request Feb 12, 2025
In cozy/cozy-libs#2720 we added PerformanceAPI in the SearchEngine

This commit reflect the changes to the SearchEngine constructor

Related PR: cozy/cozy-libs#2720
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants