Package com.wavefront.slug.chart
Interface ChartSlugBuilder
-
- All Known Implementing Classes:
ChartSlugBuilderImpl
public interface ChartSlugBuilderInterface ofChartSlugBuilderImpl- Author:
- Yutian Wu (wyutian@vmware.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ChartSlugBuilderaddFocusedHost(String hostName)Add a host that is focused upon when the page loads.ChartSlugBuilderaddSource(String name, String query)Add a new source query to the chart.ChartSlugBuilderaddSource(String name, String query, boolean disabled)Add a new source query to the chart.ChartSlugBuilderaddSource(String name, String query, boolean disabled, String queryBuilderSerialization, boolean queryBuilderEnabled)Add a new source query to the chart.Stringbuild()Build the chart slug.StringbuildAndEncode()Deprecated.usebuildAndEscape()instead to avoid incorrect escape in url fragments.StringbuildAndEscape()Build and escape the chart slug to be used in the chart url.ChartSlugBuildersetBase(int base)Sets the base of the y-axis of the chart.ChartSlugBuildersetChartAttributes(String chartAttributes)Sets the chart's attributes from a JSON serialized string.ChartSlugBuildersetChartSettings(ChartSettings chartSettings)Sets the chart's settings from a ChartSettings objects.ChartSlugBuildersetChartSettings(String chartSettings)Sets the chart's settings from a JSON serialized string.ChartSlugBuildersetCompare(String compare)Sets the comparison option for the entire chart.ChartSlugBuildersetCustomerId(String customerId)Set the customer id for the chart.ChartSlugBuildersetDescription(String description)Sets the description of the chart.ChartSlugBuildersetEnd(long endMillis)Set the end millis.ChartSlugBuildersetEnd(org.joda.time.ReadableInstant instant)Set the end millis.ChartSlugBuildersetGranularity(String granularity)Set the granularity of the entire chart.ChartSlugBuildersetId(String id)Set the chart id.ChartSlugBuildersetName(String name)Set the name of the chart.ChartSlugBuildersetStart(long startMillis)Set the start millis.ChartSlugBuildersetStart(org.joda.time.ReadableInstant instant)Set the start instant.ChartSlugBuildersetUnits(String units)Units to use for the chart (rendered to the right of the Y-axis).
-
-
-
Method Detail
-
setCustomerId
ChartSlugBuilder setCustomerId(String customerId)
Set the customer id for the chart.- Parameters:
customerId- Customer Id for the chart.- Returns:
- The builder.
-
setId
ChartSlugBuilder setId(String id)
Set the chart id. This is technically used only when redirected from a dashboard and defaults to "chart".- Parameters:
id- The id for the chart.- Returns:
- The builder.
-
setName
ChartSlugBuilder setName(String name)
Set the name of the chart.- Parameters:
name- Name of the chart.- Returns:
- The builder.
-
setStart
ChartSlugBuilder setStart(long startMillis)
Set the start millis.- Parameters:
startMillis- Start millis.- Returns:
- The builder.
-
setStart
ChartSlugBuilder setStart(org.joda.time.ReadableInstant instant)
Set the start instant.- Parameters:
instant- The start instant.- Returns:
- The builder.
-
setEnd
ChartSlugBuilder setEnd(long endMillis)
Set the end millis.- Parameters:
endMillis- End millis.- Returns:
- The builder.
-
setEnd
ChartSlugBuilder setEnd(org.joda.time.ReadableInstant instant)
Set the end millis.- Parameters:
instant- The end instant.- Returns:
- The builder.
-
setGranularity
ChartSlugBuilder setGranularity(String granularity)
Set the granularity of the entire chart. Valid values are determined by the FE. Possible values include: "m", "h", "d" and "auto". Defaults to "auto".- Parameters:
granularity- The granularity to use.- Returns:
- The builder.
-
setCompare
ChartSlugBuilder setCompare(String compare)
Sets the comparison option for the entire chart. Valid values are determined by the FE. Possible values include: "1d", "1w", "1m". Defaults to null.- Parameters:
compare- Comparison option to set for the chart.- Returns:
- The builder.
-
setUnits
ChartSlugBuilder setUnits(String units)
Units to use for the chart (rendered to the right of the Y-axis).- Parameters:
units- Units to use for the chart.- Returns:
- The builder.
-
setBase
ChartSlugBuilder setBase(int base)
Sets the base of the y-axis of the chart. Value must be >= 1. A value of 1 indicates that a linear y-axis should be used.- Parameters:
base- Y-axis base.- Returns:
- The builder.
-
setDescription
ChartSlugBuilder setDescription(String description)
Sets the description of the chart.- Parameters:
description- chart description.- Returns:
- The builder.
-
setChartSettings
ChartSlugBuilder setChartSettings(String chartSettings)
Sets the chart's settings from a JSON serialized string.- Parameters:
chartSettings- chart settings string- Returns:
- The builder.
-
setChartSettings
ChartSlugBuilder setChartSettings(ChartSettings chartSettings)
Sets the chart's settings from a ChartSettings objects.- Parameters:
chartSettings- chart settings string- Returns:
- The builder.
-
setChartAttributes
ChartSlugBuilder setChartAttributes(String chartAttributes)
Sets the chart's attributes from a JSON serialized string.- Parameters:
chartAttributes- chart settings string- Returns:
- The builder.
-
addSource
ChartSlugBuilder addSource(String name, String query)
Add a new source query to the chart.- Parameters:
name- Name of the query.query- The query.- Returns:
- The builder.
-
addSource
ChartSlugBuilder addSource(String name, String query, boolean disabled)
Add a new source query to the chart.- Parameters:
name- Name of the query.query- The query.disabled- True if this query should be disabled (unchecked) in the chart.- Returns:
- The builder.
-
addSource
ChartSlugBuilder addSource(String name, String query, boolean disabled, String queryBuilderSerialization, boolean queryBuilderEnabled)
Add a new source query to the chart.- Parameters:
name- Name of the query.query- The query.disabled- True if this query should be disabled (unchecked) in the chart.queryBuilderSerialization- Serialization of the querybuilderqueryBuilderEnabled- True if the querybuilder is enabled- Returns:
- The builder.
-
addFocusedHost
ChartSlugBuilder addFocusedHost(String hostName)
Add a host that is focused upon when the page loads. The chart must contain queries that yield host tags (e.g. host=abcd01 or host=*) for focusing to work.- Parameters:
hostName- Host name for series tagged by it to be focused on.- Returns:
- The builder.
-
build
String build()
Build the chart slug.- Returns:
- The chart slug.
-
buildAndEscape
String buildAndEscape()
Build and escape the chart slug to be used in the chart url.
-
buildAndEncode
@Deprecated String buildAndEncode()
Deprecated.usebuildAndEscape()instead to avoid incorrect escape in url fragments. Build and encoded the chart slug to be used in the chart url. This only works in v1 slugs, as it encodes special characters as well.
-
-