Class WaitReasonStatisticsCollector
- java.lang.Object
-
- jetbrains.buildServer.serverSide.ProjectsModelListenerAdapter
-
- jetbrains.buildServer.serverSide.BuildServerAdapter
-
- jetbrains.buildServer.serverSide.impl.WaitReasonStatisticsCollector
-
- All Implemented Interfaces:
EventListener,BuildDistributionCallback,BuildServerListener,ProjectsModelListener,ServerListener,TeamCityExtension
public class WaitReasonStatisticsCollector extends BuildServerAdapter implements BuildDistributionCallback
- Author:
- Yegor.Yarko Date: 26/04/2019
-
-
Field Summary
Fields Modifier and Type Field Description static StringPERSIST_INTERVAL_PROPERTYstatic StringSTATISTIC_VALUE_PREFIX
-
Constructor Summary
Constructors Constructor Description WaitReasonStatisticsCollector(EventDispatcher<BuildServerListener> dispatcher, ExecutorServices executor, BuildDataStorage buildDataStorage, CachingBuildEstimator buildEstimator, ServerResponsibility serverResponsibility, ServerBuildDelayMetrics buildDelayMetrics)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawaitSave()Awaits for the persistance of the wait reasons to the database for queued buildvoidbuildStarted(SRunningBuild build)Called when build is about to start.voiddistributionFinished()voiddistributionStarted()Map<String,Long>getCurrentWaitReasons(SQueuedBuild queuedBuild)StringgetLatestWaitReason(SQueuedBuild queuedBuild)static StringmakeDetailsByStatisticKey(String key)Recover human-friendly description from the build statistic keymakeStatisticKey(String)voidonBuildAddedToQueue(SQueuedBuild build)voidonBuildRemovedFromQueue(SQueuedBuild queuedBuild, User user, String comment)voidsetTimeService(TimeService timeService)voidwaitReasonSet(QueuedBuildInfo build, WaitReason reason)-
Methods inherited from class jetbrains.buildServer.serverSide.BuildServerAdapter
agentDescriptionUpdated, agentRegistered, agentRemoved, agentRemoved, agentsDescriptionUpdated, agentStatusChanged, agentUnregistered, agentUnregistered, beforeAgentUnregistered, beforeBuildFinish, beforeEntryDelete, beforeServerConfigurationLoaded, buildArtifactsChanged, buildChangedStatus, buildCommented, buildDetachedFromAgent, buildFinished, buildInterrupted, buildPinned, buildProblemsChanged, buildProblemsMuted, buildProblemsUnmuted, buildPromotionTagsChanged, buildQueueOrderChanged, buildRemovedFromQueue, buildTagsChanged, buildTagsChanged, buildTypeAddedToQueue, buildTypeAddedToQueue, buildUnpinned, changeAdded, changesLoaded, changesLoaded, cleanupFinished, cleanupStarted, entriesDeleted, entryCreated, entryDeleted, labelingFailed, labelingSucceed, messageReceived, pluginsLoaded, responsibleChanged, responsibleChanged, responsibleChanged, responsibleChanged, responsibleRemoved, responsibleRemoved, serverConfigurationReloaded, serverShutdown, serverShutdownComplete, serverStartup, sourcesVersionReleased, sourcesVersionReleased, sourcesVersionReleased, statisticValuePublished, testsMuted, testsUnmuted
-
Methods inherited from class jetbrains.buildServer.serverSide.ProjectsModelListenerAdapter
beforeBuildTypeDeleted, beforeBuildTypesDeleted, buildTypeActiveStatusChanged, buildTypeDeleted, buildTypeDescriptionUpdated, buildTypeExternalIdChanged, buildTypeMoved, buildTypePersisted, buildTypeRegistered, buildTypeRenamed, buildTypeTemplateDeleted, buildTypeTemplateDeleted, buildTypeTemplateExternalIdChanged, buildTypeTemplateMoved, buildTypeTemplatePersisted, buildTypeTemplateRestored, buildTypeUnregistered, projectArchived, projectCreated, projectDearchived, projectDescriptionUpdated, projectExternalIdChanged, projectFeatureAdded, projectFeatureChanged, projectFeatureRemoved, projectMoved, projectPersisted, projectPluginDataFileRemoved, projectPluginDataFileSaved, projectRemoved, projectRemoved, projectRenamed, projectRestored, vcsRootExternalIdChanged, vcsRootMoved, vcsRootPersisted, vcsRootRemoved, vcsRootsPersisted, vcsRootUpdated
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.ProjectsModelListener
beforeBuildTypeDeleted, beforeBuildTypesDeleted, buildTypeActiveStatusChanged, buildTypeDeleted, buildTypeDescriptionUpdated, buildTypeExternalIdChanged, buildTypeMoved, buildTypePersisted, buildTypeRegistered, buildTypeRenamed, buildTypeTemplateDeleted, buildTypeTemplateDeleted, buildTypeTemplateExternalIdChanged, buildTypeTemplateMoved, buildTypeTemplatePersisted, buildTypeTemplateRestored, buildTypeUnregistered, projectArchived, projectCreated, projectDearchived, projectDescriptionUpdated, projectExternalIdChanged, projectFeatureAdded, projectFeatureChanged, projectFeatureRemoved, projectMoved, projectPersisted, projectPluginDataFileRemoved, projectPluginDataFileSaved, projectRemoved, projectRemoved, projectRenamed, projectRestored, vcsRootExternalIdChanged, vcsRootMoved, vcsRootPersisted, vcsRootRemoved, vcsRootsPersisted, vcsRootUpdated
-
-
-
-
Field Detail
-
STATISTIC_VALUE_PREFIX
public static final String STATISTIC_VALUE_PREFIX
- See Also:
- Constant Field Values
-
PERSIST_INTERVAL_PROPERTY
public static final String PERSIST_INTERVAL_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WaitReasonStatisticsCollector
public WaitReasonStatisticsCollector(@NotNull EventDispatcher<BuildServerListener> dispatcher, @NotNull ExecutorServices executor, @NotNull BuildDataStorage buildDataStorage, @NotNull CachingBuildEstimator buildEstimator, @NotNull ServerResponsibility serverResponsibility, @NotNull ServerBuildDelayMetrics buildDelayMetrics)
-
-
Method Detail
-
setTimeService
public void setTimeService(@NotNull TimeService timeService)
-
distributionStarted
public void distributionStarted()
- Specified by:
distributionStartedin interfaceBuildDistributionCallback
-
distributionFinished
public void distributionFinished()
- Specified by:
distributionFinishedin interfaceBuildDistributionCallback
-
waitReasonSet
public void waitReasonSet(@NotNull QueuedBuildInfo build, @NotNull WaitReason reason)- Specified by:
waitReasonSetin interfaceBuildDistributionCallback
-
onBuildAddedToQueue
public void onBuildAddedToQueue(@NotNull SQueuedBuild build)
-
onBuildRemovedFromQueue
public void onBuildRemovedFromQueue(@NotNull SQueuedBuild queuedBuild, User user, String comment)
-
buildStarted
public void buildStarted(@NotNull SRunningBuild build)Description copied from interface:BuildServerListenerCalled when build is about to start. Changes are not loaded yet, and build agent didn't start the build yet.- Specified by:
buildStartedin interfaceBuildServerListener- Overrides:
buildStartedin classBuildServerAdapter- Parameters:
build- build configuration whose status has changed
-
getLatestWaitReason
@Nullable public String getLatestWaitReason(@NotNull SQueuedBuild queuedBuild)
-
getCurrentWaitReasons
@NotNull public Map<String,Long> getCurrentWaitReasons(@NotNull SQueuedBuild queuedBuild)
-
awaitSave
@TestOnly public void awaitSave()
Awaits for the persistance of the wait reasons to the database for queued build
-
-