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

Jrm/optimise query #3677

Merged
merged 2 commits into from
Jan 17, 2025
Merged

Jrm/optimise query #3677

merged 2 commits into from
Jan 17, 2025

Conversation

JR-Morgan
Copy link
Member

@JR-Morgan JR-Morgan commented Jan 17, 2025

Several queries were setting the commitsLimit to be 0 thinking that that would lead to zero commits queried.
However, 0 is often interpreted by our server to mean "default" and thus leads to lots of commits being requested unessearily.

@gjedlicska identified one of these queries to be significantly taxing on the server.

In this PR I have:

  • Changed two of the queries that we were mis using 0 limit:
    • Client side, 0 limit will be used to set a includeCommits @include tag to prevent querying for commits when the caller passes in a limit of 0.
    • Yes, this is not aligned elsewhere... but the "proper" solution to this problem is to create more specific queries (which we've already done for the new Projects/Models/Versions API. This is legacy code, and as such, I was looking for a quick solution.
  • Several callers were using the default of 10 commits out of laziness, even if they did not need to use any commit data, or just needed the latest commit, I've updated these to fetch an appropriate number of commits.
  • Several of the branch.commits queries were fetching the branchName property of the commit. This is slow for the server to have to do for many commits, and as such, client side, we are only requesting the branch.name, and then post-request, setting this value on all of the requested commits.
    • bit of a maintenance nightmare, but reminder that this is not a problem for the new projects/models/versions API

@JR-Morgan JR-Morgan requested a review from gjedlicska January 17, 2025 12:22
@JR-Morgan JR-Morgan merged commit 2176e5e into dev Jan 17, 2025
32 checks passed
@JR-Morgan JR-Morgan deleted the jrm/optimiseQuery branch January 17, 2025 13:07
JR-Morgan added a commit that referenced this pull request Feb 4, 2025
* fix(navis): Fixes missing element properties on coalesce from First Selected object. (#3651)

* Correct access for const

* Corrected NullParam exception signature

* LINQ logic made logical

* corrected correction

* indent all the things

* minor(navis): coalesced properties to reflect instance as dominant on duplicate (#3652)

* Correct access for const

* Corrected NullParam exception signature

* LINQ logic made logical

* corrected correction

* indent all the things

* First becomes Last

* Limit FE1 API usage to essentials (#3662)

* Updated DUI2

* remove comment subscription

* Comments

* fix comment

* VersionUpdate subscription workaround

* Dynamo

* Fixed issue with collections being modified while enumerating

* removed deprecated tests

* Marked deprecated true on all legacy subscriptions

* using directives

* CNX-961 - Remove keyboard shortcuts from plugin registration (#3667)

Remove keyboard shortcuts from plugin registration

* fix(Revit): DirectShape Instances to Speckle Conversion support (#3572)

For POC purposes - implements a fix - needs investigation

* Jrm/ci fix (#3670)

* Ensure CI runs on net8

* remove net 7

* bump csharpier for net8 support

* ensure net8 sdk is available on connector builds

* relax rollforward rules instead

* Fixed email invites (#3669)

* removed chunking from model class. (#3668)

Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>

* CNX-619 Revit Analytical Panel (#3645)

* File Added: ConvertStructuralMaterial

Separated methods pertaining to StructuralMaterial outside of the ConvertAnalyticalStick.cs file. Didn't make sense that these functions were in the ConvertAnalyticalStick.cs when the ConvertAnalyticalSurface.cs referenced them

* ScaleToSpeckle

Material properties were sent as revit internal units. Inconsistent with the Revit model / project units. These can't be used for connection applications (e.g. receiving analytical elements in ETABS)

* ETABS Receive Property2D

ETABS currently only created properties for Element2Ds with a CSIProperty2D, but what about Property2D? These should also be received without us defaulting to the "Slab1" ETABS section.

* ETABS Receive Wall Property

Walls were previously assigned with slab sections which is incorrect. The WallPropertyToNative() was implemented (previously raised a ConversionNotSupportedException for some reason)

* RVT 22 Scaling Updates

Testing on Revit 2022 - ETABS connection

* Default Fallback

Assign at least something to Element2D

* Fixed shared project case sensitivity

* IDE0005

---------

Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>

* Revert deploy step to use .NET 6 SDK for Manager Feed (#3671)

* Fix ping in SDK and add user agent headers (#3672)

* ping should ping a static asset and add user agent headers

* fix: fmt

* Removed frontend headers check for FE1 servers

* Removed another test that relied on this pinging

---------

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>

* Remove Node Run events from GH nodes (#3674)

Removed tracking for grasshopper node runs

* Ping `/api/ping` with fallbacks to older style pings (#3676)

* Multi-ping

* tests

* adjusted timeouts

* Removed favourite stream count from DUI2 stream view (#3675)

* Jrm/optimise query (#3677)

* Optimised large queries

* fix mistake

* Jrm/optimise query (#3678)

* Optimised large queries

* fix mistake

* fix another mistake

* fix: Disappearing Grasshopper components after save (#3679)

* fix: Dissapearing components after save

SyncReceive would disappear upon opening a document (or while saving) due to exceptions being thrown in the Read/Write logic, which shouldn't ever throw.

* fix: Write method for Kit name is unnecessary, dealt with in parent class

* fix(gh): Use external getter for `Value` property (#3680)

Do not assume internal storage `m_value` will exist in all GH_Goo's, some have varying implementation, but `Value` is usually consistent on all pre-rhino8 GH types

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
Co-authored-by: Jonathon Broughton <760691+jsdbroughton@users.noreply.github.com>
Co-authored-by: Mucahit Bilal GOKER <51519350+bimgeek@users.noreply.github.com>
Co-authored-by: Björn Steinhagen <steinhagen.bjoern@gmail.com>
Co-authored-by: Adam Hathcock <adamhathcock@users.noreply.github.com>
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
JR-Morgan added a commit that referenced this pull request Feb 5, 2025
* fix(navis): Fixes missing element properties on coalesce from First Selected object. (#3651)

* Correct access for const

* Corrected NullParam exception signature

* LINQ logic made logical

* corrected correction

* indent all the things

* minor(navis): coalesced properties to reflect instance as dominant on duplicate (#3652)

* Correct access for const

* Corrected NullParam exception signature

* LINQ logic made logical

* corrected correction

* indent all the things

* First becomes Last

* Limit FE1 API usage to essentials (#3662)

* Updated DUI2

* remove comment subscription

* Comments

* fix comment

* VersionUpdate subscription workaround

* Dynamo

* Fixed issue with collections being modified while enumerating

* removed deprecated tests

* Marked deprecated true on all legacy subscriptions

* using directives

* CNX-961 - Remove keyboard shortcuts from plugin registration (#3667)

Remove keyboard shortcuts from plugin registration

* fix(Revit): DirectShape Instances to Speckle Conversion support (#3572)

For POC purposes - implements a fix - needs investigation

* Jrm/ci fix (#3670)

* Ensure CI runs on net8

* remove net 7

* bump csharpier for net8 support

* ensure net8 sdk is available on connector builds

* relax rollforward rules instead

* Fixed email invites (#3669)

* removed chunking from model class. (#3668)

Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>

* CNX-619 Revit Analytical Panel (#3645)

* File Added: ConvertStructuralMaterial

Separated methods pertaining to StructuralMaterial outside of the ConvertAnalyticalStick.cs file. Didn't make sense that these functions were in the ConvertAnalyticalStick.cs when the ConvertAnalyticalSurface.cs referenced them

* ScaleToSpeckle

Material properties were sent as revit internal units. Inconsistent with the Revit model / project units. These can't be used for connection applications (e.g. receiving analytical elements in ETABS)

* ETABS Receive Property2D

ETABS currently only created properties for Element2Ds with a CSIProperty2D, but what about Property2D? These should also be received without us defaulting to the "Slab1" ETABS section.

* ETABS Receive Wall Property

Walls were previously assigned with slab sections which is incorrect. The WallPropertyToNative() was implemented (previously raised a ConversionNotSupportedException for some reason)

* RVT 22 Scaling Updates

Testing on Revit 2022 - ETABS connection

* Default Fallback

Assign at least something to Element2D

* Fixed shared project case sensitivity

* IDE0005

---------

Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>

* Revert deploy step to use .NET 6 SDK for Manager Feed (#3671)

* Fix ping in SDK and add user agent headers (#3672)

* ping should ping a static asset and add user agent headers

* fix: fmt

* Removed frontend headers check for FE1 servers

* Removed another test that relied on this pinging

---------

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com>

* Remove Node Run events from GH nodes (#3674)

Removed tracking for grasshopper node runs

* Ping `/api/ping` with fallbacks to older style pings (#3676)

* Multi-ping

* tests

* adjusted timeouts

* Removed favourite stream count from DUI2 stream view (#3675)

* Jrm/optimise query (#3677)

* Optimised large queries

* fix mistake

* Jrm/optimise query (#3678)

* Optimised large queries

* fix mistake

* fix another mistake

* fix: Disappearing Grasshopper components after save (#3679)

* fix: Dissapearing components after save

SyncReceive would disappear upon opening a document (or while saving) due to exceptions being thrown in the Read/Write logic, which shouldn't ever throw.

* fix: Write method for Kit name is unnecessary, dealt with in parent class

* fix(gh): Use external getter for `Value` property (#3680)

Do not assume internal storage `m_value` will exist in all GH_Goo's, some have varying implementation, but `Value` is usually consistent on all pre-rhino8 GH types

* Branch get nullabilty

* fixed test warnings

* Fix perf tests

---------

Co-authored-by: Alan Rynne <alan@speckle.systems>
Co-authored-by: Jonathon Broughton <760691+jsdbroughton@users.noreply.github.com>
Co-authored-by: Mucahit Bilal GOKER <51519350+bimgeek@users.noreply.github.com>
Co-authored-by: Björn Steinhagen <steinhagen.bjoern@gmail.com>
Co-authored-by: Adam Hathcock <adamhathcock@users.noreply.github.com>
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
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.

2 participants