jetbrains.buildServer.serverSide.statistics.build
Interface BuildDataStorage


public interface BuildDataStorage

Storage for build metrics


Method Summary
 java.util.SortedSet<java.lang.String> getAgents(BuildChartSettings chartSettings)
          Returns agents list for given filter settings.
 BuildValue getData(java.lang.String valueTypeKey, BuildValueTransformer buildValueTransformer, long finishedBuildId, java.lang.String externalBuildTypeId)
          Deprecated. since 8.0 use getData(String, BuildValueTransformer, jetbrains.buildServer.serverSide.SBuild) or SBuild.getStatisticValue(String).
 BuildValue getData(java.lang.String valueTypeKey, BuildValueTransformer buildValueTransformer, SBuild build)
          Get individual statistic value for given value type and build (finished or running)
 java.util.List<BuildValue> getDataSet(java.lang.String valueTypeKey, BuildChartSettings chartSettings, BuildValueTransformer buildValueTransformer)
          Retrieve sorted list of values for given metric, filtered according to given settings.
 java.math.BigDecimal getValue(java.lang.String valueTypeKey, long buildId)
          Returns raw statistic value as it is stored in database for a given value type and a build.
 java.util.Map<java.lang.String,java.math.BigDecimal> getValues(SBuild build)
          All raw values for a given build
 boolean hasDataFor(java.lang.String valueTypeKey, java.lang.String externalBuildTypeId)
          Flags whether any data was stored for given metric & buildTypeId pair
 void publishValue(java.lang.String valueTypeKey, long buildId, java.math.BigDecimal value)
          Store single build metric value
 

Method Detail

publishValue

void publishValue(java.lang.String valueTypeKey,
                  long buildId,
                  java.math.BigDecimal value)
Store single build metric value

Parameters:
valueTypeKey - metric key
buildId - build that metric was calculated upon
value - metric value

getDataSet

@NotNull
java.util.List<BuildValue> getDataSet(java.lang.String valueTypeKey,
                                              @NotNull
                                              BuildChartSettings chartSettings,
                                              @Nullable
                                              BuildValueTransformer buildValueTransformer)
Retrieve sorted list of values for given metric, filtered according to given settings. There will be BuildValue object for each build, even if there is no metric value for the given build.

Parameters:
valueTypeKey - metric key
chartSettings - build chart settings
buildValueTransformer - optional transformer to be applied to each value
Returns:
list of metric values combined with its build data

getData

@Nullable
BuildValue getData(java.lang.String valueTypeKey,
                            @Nullable
                            BuildValueTransformer buildValueTransformer,
                            long finishedBuildId,
                            java.lang.String externalBuildTypeId)
Deprecated. since 8.0 use getData(String, BuildValueTransformer, jetbrains.buildServer.serverSide.SBuild) or SBuild.getStatisticValue(String).

Get individual statistic value for given value type and finished build

Parameters:
valueTypeKey - metric key
buildValueTransformer - optional transformer to be applied to the value
finishedBuildId - identifier of the finished build
externalBuildTypeId - external identifier of the build configuration
Returns:
metric value for given parameters, null if not available

getData

@Nullable
BuildValue getData(@NotNull
                            java.lang.String valueTypeKey,
                            @Nullable
                            BuildValueTransformer buildValueTransformer,
                            @NotNull
                            SBuild build)
Get individual statistic value for given value type and build (finished or running)

Parameters:
valueTypeKey - metric key
buildValueTransformer - optional transformer to be applied to the value
build - finished or running build
Returns:
metric value for given parameters, null if not available
Since:
8.0

getAgents

java.util.SortedSet<java.lang.String> getAgents(@NotNull
                                                BuildChartSettings chartSettings)
Returns agents list for given filter settings.

Parameters:
chartSettings - build chart settings
Returns:
agent names

hasDataFor

boolean hasDataFor(java.lang.String valueTypeKey,
                   java.lang.String externalBuildTypeId)
Flags whether any data was stored for given metric & buildTypeId pair

Parameters:
valueTypeKey - metric key
externalBuildTypeId - build configuration external identifier
Returns:
true if there is some data for given metric and given buildTypeId

getValue

@Nullable
java.math.BigDecimal getValue(java.lang.String valueTypeKey,
                                       long buildId)
Returns raw statistic value as it is stored in database for a given value type and a build. Note that raw value can differ from one returned by getData(String, BuildValueTransformer, jetbrains.buildServer.serverSide.SBuild) method because of possible transformation applied by BuildValueTransformer.

Parameters:
valueTypeKey - metric key
buildId - identifier of the build
buildTypeId - identifier of the build configuration
Returns:
metric value for given parameters, null if not available

getValues

@NotNull
java.util.Map<java.lang.String,java.math.BigDecimal> getValues(@NotNull
                                                                       SBuild build)
All raw values for a given build

Since:
8.0