jenkinsci / lockable-resources-plugin

Lock resources against concurrent use
https://plugins.jenkins.io/lockable-resources
MIT License
87 stars 185 forks source link

Show resource history #393

Open mPokornyETM opened 2 years ago

mPokornyETM commented 2 years ago

What feature do you want to see added?

As a jenkins administrator I would see history of resource locks/reservations, like in the node usage history.

This will help us to see which resources is used most time.

This will work only in extra resource page. This shall be accessed via /lockable-resources/. In this page might be shown other important information, there are hard to show in table overview.

Ex #275

Upstream changes

No response

mPokornyETM commented 1 year ago

Overview page shall shows all resources (current state) image

The page Labels shall shows all configured labels image

And the page History shall shows history. I hope it will be possible to hook into PrintStream.println() and write all the lines in to logger too. In that case we can use full logger functionality (like prio filter , log rotator ...) and just query the logger for entries. Each entry shall be shown in the history table. (Maybe is better name 'Logs') PrintStream logger = getContext().get(TaskListener.class).getLogger(); logger.println("Trying to acquire lock on [" + step + "]");

I propose to create for all the sub pages own jelly file. Otherwise will be 'src\main\resources\org\jenkins\plugins\lockableresources\actions\LockableResourcesRootAction\index.jelly' no more maintainable

mPokornyETM commented 1 year ago

@jimklimov what you think about that. Before I do next big change.

mPokornyETM commented 1 year ago

Note for developer. The most work here will be to make the pipeline logs and loggers more consistent. Currently is the logging little weird. Then we can use loggers as well and show entries as a table. Or just keep it and use jenkins logger page. But I propose to make new view in lockable-resources page. Because jenkins loggers are little hard to read. There is no filtering possible and user needs to open 2 pages instead of all information in one page.

This item takes longer as you think. Trust me 😉