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

Optimization of `GoDashboardCurrentStateLoader` #4706

Merged
merged 2 commits into from May 7, 2018

Conversation

Projects
None yet
2 participants
@ketan
Copy link
Member

commented May 4, 2018

Do not perform the DB query to load pipelines if list of pipelines has
not changed.

A further optimization would be to load from the DB, only the pipelines
that have been newly added. Pipelines that have been removed do not
require a DB call, and we can simply purge those from the
historyForDashboard instance variable.

@ketan ketan requested review from jyotisingh and arvindsv May 4, 2018

HashSet<CaseInsensitiveString> newPipelineNames = new HashSet<>(allPipelineNames);
if (!newPipelineNames.equals(previousPipelineNames)) {
List<String> pipelineNames = CaseInsensitiveString.toStringList(allPipelineNames);
historyForDashboard = loadHistoryForPipelines(pipelineNames);

This comment has been minimized.

Copy link
@jyotisingh

jyotisingh May 4, 2018

Contributor

Dont we need to update historyForDashboard on pipeline-config-api callback?

This comment has been minimized.

Copy link
@ketan

ketan May 4, 2018

Author Member

which callback is this?

@ketan ketan added this to the Release 18.4 milestone May 4, 2018

@ketan ketan force-pushed the ketan:optimize/dashboard-reload branch 2 times, most recently from c0e5ca9 to d4945f3 May 4, 2018

ketan added some commits May 4, 2018

Optimization of `GoDashboardCurrentStateLoader`
Do not perform the DB query to load pipelines if list of pipelines has
not changed.

A further optimization would be to load from the DB, only the pipelines
that have been newly added. Pipelines that have been removed do not
require a DB call, and we can simply purge those from the
`historyForDashboard` instance variable.
Second level of optimization for `GoDashboardCurrentStateLoader`
Load any new pipelines from DB. Pipelines in the config that have been
removed do not require a DB call, we simply purge those from the
`historyForDashboard` instance variable.

@ketan ketan force-pushed the ketan:optimize/dashboard-reload branch from d4945f3 to fc405f3 May 4, 2018

@ketan ketan merged commit fc405f3 into gocd:master May 7, 2018

8 checks passed

build-linux-PR/build-non-server
Details
build-linux-PR/build-server
Details
build-windows-PR/build-non-server
Details
build-windows-PR/build-server
Details
installers-PR/dist
Details
license/cla Contributor License Agreement is signed.
Details
plugins-PR/build
Details
trigger/do-nothing
Details

@ketan ketan deleted the ketan:optimize/dashboard-reload branch May 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.