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

Optimize network traffic for Jenkins plugin #25

Closed
steffen-wilke opened this issue Jan 13, 2020 · 2 comments
Closed

Optimize network traffic for Jenkins plugin #25

steffen-wilke opened this issue Jan 13, 2020 · 2 comments
Labels
Area: Jenkins enhancement New feature or request
Milestone

Comments

@steffen-wilke
Copy link
Member

Currently the Jenkins Plugin is calling the API on every tick (every 10 sec) for every build project. However, projects that are not building, usually don't update any of their data. An update is typically only required if the state changed or while the build is running.

For projects on the same Jenkins server, we could improve the current implementation by asking the Jenkins API first about the current states of the projects (i.e. "which jobs are building").
Only for the projects that are actually building or that changed their state, we would then need to retrieve detailed information.

Imagine a WhatsON configuration with 50 projects on the same Jenkins server. Typically only a fraction of the projects is building simultaneously: let's say 5 jobs are building.

Current = 50 calls to the Jenkins API
Suggested = 1 + 5 calls to the Jenkins API

The only restriction on this optimization is when folders are used to structure the Jenkins instance. The API needs to know the depth of the call it should perform.

API call for depth 3:

https://{MY_JENKINS_URL}/api/json?tree=jobs[name,lastBuild[building],jobs[name,lastBuild[building],jobs[name,lastBuild[building]]]]&pretty

I'd suggest a default depth of 3 and if projects are located deeper in the folder hierarchy, we could query them explicitly like we currently do.

steffen-wilke added a commit that referenced this issue Jan 13, 2020
This has been achieved by receiving information about the latest build with the build job API call.

Issue #25
@dominikgolda
Copy link
Collaborator

12f51fe causes change notifications to be shown on application startup.

@dominikgolda
Copy link
Collaborator

Changing some settings (I tried with Open minimized) and applying configuration also causes notifications to appear. 12f51fe is also to blame.

dominikgolda added a commit that referenced this issue Jan 16, 2020
…tifications being shown incorrectely as well as prevents Application.Current.MainWindow getting set.
@steffen-wilke steffen-wilke added this to the v1.0.0 milestone Jan 20, 2020
@steffen-wilke steffen-wilke modified the milestones: v1.0.0, v0.9.2-beta Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Jenkins enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants