Package se.diabol.jenkins.pipeline.cache
Class ModelCache
java.lang.Object
se.diabol.jenkins.pipeline.cache.ModelCache
Remembers computed view models for a short while, so that many browsers polling the same view do not each walk
the build history. An entry remembers the jobs its model shows: when a build of one of them starts, ends or is
deleted, or one of them enters or leaves the queue, only the entries showing that job are dropped, so that a busy
controller does not recompute every board on every event. A job being created, reconfigured, renamed or deleted
empties the cache, because that can change which jobs belong to which pipeline. A model that contains a running
or queued build expires quickly on its own as well, because stages of a Pipeline run come and go without any of
those events.
Two system properties tune how long an entry may be served, in seconds, and are read on every request so that they can be changed at runtime as well as set at startup:
se.diabol.jenkins.pipeline.cache.ModelCache.idleSeconds(default 30) for a model in which nothing is running or queued;se.diabol.jenkins.pipeline.cache.ModelCache.activeSeconds(default 2) for a model with a running or queued build, which bounds how stale a progress bar or a Pipeline stage can be.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA cached model as it is served: its components, a version that changes with every recomputation, which conditional requests compare, and the exported form per viewer, computed once and kept with the model.static classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe cached model for the key with its version and exported forms, or the loader's result which is then cached.voidclear()static ModelCacheget()The cached model for the key, or the loader's result which is then cached.voidinvalidate(String jobFullName) Drops the models that show the job, or something inside it such as a matrix configuration or a promotion.
-
Constructor Details
-
ModelCache
public ModelCache()
-
-
Method Details
-
get
-
get
The cached model for the key, or the loader's result which is then cached. -
cached
The cached model for the key with its version and exported forms, or the loader's result which is then cached. -
clear
public void clear() -
invalidate
Drops the models that show the job, or something inside it such as a matrix configuration or a promotion.
-