Package jetbrains.buildServer.metrics
Class ServerMetricsFactory
- java.lang.Object
-
- jetbrains.buildServer.metrics.ServerMetricsFactory
-
- All Implemented Interfaces:
ServerMetrics,ServerMetricsEx,ServerMetricsReader,Disposable
public class ServerMetricsFactory extends Object implements ServerMetricsEx, Disposable
- Author:
- kir
-
-
Field Summary
Fields Modifier and Type Field Description static jetbrains.buildServer.metrics.EmptyMetricsEMPTY_METRICS-
Fields inherited from interface jetbrains.buildServer.metrics.ServerMetricsEx
DISABLED_METRICS_PROPERTY, METRICS_ADD_NODE_ID_TAG_PROPERTY, TEAMCITY_METRICS_INTERNAL_ENABLED
-
-
Constructor Summary
Constructors Constructor Description ServerMetricsFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommonTag(String name, String value)voiddispose()StringgetAllMetricsText(MetricQueryBuilder metricQuery)MetricBuildermetricBuilder(String metricName)MetricBuilderprojectMetricBuilder(String metricName, String projectExtId, String buildTypeExtId)Creates a metric builder for a metric associated with a project, and optionally, with a build configuration.MetricQueryBuilderprojectQueryBuilder(Collection<String> projectExtIds)Returns a query builder for metrics created withServerMetrics.projectMetricBuilder(String, String, String)builder.MetricQueryBuilderqueryBuilder()voidunregisterAll()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.metrics.ServerMetricsEx
callCounter
-
-
-
-
Method Detail
-
metricBuilder
@NotNull public MetricBuilder metricBuilder(@NotNull String metricName)
- Specified by:
metricBuilderin interfaceServerMetrics- Parameters:
metricName- metric name, it should provide enough context so that if all records are selected just by name, the value can be meaningful. Use "." separator, like "started.builds"
-
projectMetricBuilder
public MetricBuilder projectMetricBuilder(@NotNull String metricName, @NotNull String projectExtId, @Nullable String buildTypeExtId)
Description copied from interface:ServerMetricsCreates a metric builder for a metric associated with a project, and optionally, with a build configuration. Project-scoped metrics have a separate query interface, and have a separate Prometheus endpoint. Such metrics should be reported not for all projects, but only for white-listed ones.- Specified by:
projectMetricBuilderin interfaceServerMetrics- Parameters:
metricName- metric name, it should provide enough context so that if all records are selected just by name, the value can be meaningful. Use "." separator, like "started.builds"projectExtId- project external ID, in the resulting metric is bound to projectId tagbuildTypeExtId- build configuration external ID, if present, bound to buildTypeId tag- Returns:
- see above
- See Also:
MetricBuilder,ServerMetricsReader.projectQueryBuilder(Collection)
-
queryBuilder
@NotNull public MetricQueryBuilder queryBuilder()
- Specified by:
queryBuilderin interfaceServerMetricsReader- Returns:
- A query builder to obtain metric values
-
projectQueryBuilder
public MetricQueryBuilder projectQueryBuilder(@Nullable Collection<String> projectExtIds)
Description copied from interface:ServerMetricsReaderReturns a query builder for metrics created withServerMetrics.projectMetricBuilder(String, String, String)builder.- Specified by:
projectQueryBuilderin interfaceServerMetricsReader- Parameters:
projectExtIds- Collection with projectIds for the reported metrics. If all projects should be returned, pass null.- Returns:
- see above
-
getAllMetricsText
@NotNull public String getAllMetricsText(@NotNull MetricQueryBuilder metricQuery)
- Specified by:
getAllMetricsTextin interfaceServerMetricsReader- Parameters:
metricQuery- specifies configured list of metrics for the output- Returns:
- text of all metrics in /metrics format
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
unregisterAll
public void unregisterAll()
- Specified by:
unregisterAllin interfaceServerMetricsEx
-
addCommonTag
public void addCommonTag(String name, String value)
- Specified by:
addCommonTagin interfaceServerMetricsEx
-
-