diff --git a/documentation/slis-via-dashboard.md b/documentation/slis-via-dashboard.md index c9e427721..c112dacea 100644 --- a/documentation/slis-via-dashboard.md +++ b/documentation/slis-via-dashboard.md @@ -301,6 +301,12 @@ By default SLIs are returned in the unit of the underlying metric selector. To c ![Data Explorer units - builtin:service.response.time in milliseconds](images/data-explorer-units-service-response-time.png "Data Explorer units - builtin:service.response.time in milliseconds") +The dynatrace-service will modify the metric selector to include conversion to the selected unit. In this example the reported `query` would be: + +``` +((builtin:service.response.time:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names):toUnit(MicroSecond, MilliSecond) +``` + #### Specifying resolution The resolution of the data queried from the Metrics v2 API may be set using the Resolution setting of the tile. In all cases, the dynatrace-service will attempt to obtain a single value by setting `resolution=Inf` if possible or applying a `:fold()` transformation. An error is produced if multiple values are still returned, in this instance please modify the query, e.g. using the Code tab of the Data Explorer. diff --git a/internal/dynatrace/metric_query_modifier.go b/internal/dynatrace/metric_query_modifier.go new file mode 100644 index 000000000..e5bd8e919 --- /dev/null +++ b/internal/dynatrace/metric_query_modifier.go @@ -0,0 +1,207 @@ +package dynatrace + +import ( + "context" + "fmt" + + "github.com/keptn-contrib/dynatrace-service/internal/sli/metrics" +) + +const ( + emptyUnitID = "" + autoUnitID = "auto" + noneUnitID = "none" + countUnitID = "Count" + unspecifiedUnitID = "Unspecified" + + kiloUnitID = "Kilo" + millionUnitID = "Million" + billionUnitID = "Billion" + trillionUnitID = "Trillion" +) + +// unitlessConversions lists all support conversions from Count or Unspecified to target via the map's key. +var unitlessConversions = map[string]string{ + kiloUnitID: "/1000", + millionUnitID: "/1000000", + billionUnitID: "/1000000000", + trillionUnitID: "/1000000000000", +} + +// UnknownUnitlessConversionError represents the error that an invalid target unit was specified for a unitless conversion. +type UnknownUnitlessConversionError struct { + unitID string +} + +func (e *UnknownUnitlessConversionError) Error() string { + return fmt.Sprintf("unknown unit '%s'", e.unitID) +} + +// UnableToApplyFoldToValueDefaultAggregationError represents the error that a fold is unable to be applied to a metric selector as the default aggregation type is 'value'. +type UnableToApplyFoldToValueDefaultAggregationError struct{} + +func (e *UnableToApplyFoldToValueDefaultAggregationError) Error() string { + return "unable to apply ':fold' to the metric selector as the default aggregation type is 'value'" +} + +// metricQueryModifier modifies a metrics query to return a single result and / or to convert the unit of values returned. +// It assumes that the metric definition obtained from the original metric selector is valid also for the modified ones and thus that it can be cached. +type metricsQueryModifier struct { + metricsClient MetricsClientInterface + query metrics.Query + includeFold bool + unitsConversionMetricSelectorSuffix string + setResolutionToInf bool + metricDefinition *MetricDefinition +} + +func newMetricsQueryModifier(metricsClient MetricsClientInterface, query metrics.Query) *metricsQueryModifier { + return &metricsQueryModifier{ + metricsClient: metricsClient, + query: query, + } +} + +// applyUnitConversion modifies the metric selector such that the result has the specified unit and returns the current modified query or an error. +func (u *metricsQueryModifier) applyUnitConversion(ctx context.Context, targetUnitID string) (*metrics.Query, error) { + if !doesTargetUnitRequireConversion(targetUnitID) { + return u.getModifiedQuery() + } + + metricDefinition, err := u.getMetricDefinition(ctx) + if err != nil { + return nil, err + } + + if metricDefinition.Unit == targetUnitID { + return u.getModifiedQuery() + } + + unitsConversionSnippet, err := getConversionMetricSelectorSuffix(metricDefinition, targetUnitID) + if err != nil { + return nil, err + } + + u.unitsConversionMetricSelectorSuffix = unitsConversionSnippet + return u.getModifiedQuery() +} + +// doesTargetUnitRequireConversion checks if the target unit ID requires conversion or not. Currently, "Auto" (default empty value and explicit `auto` value) and "None" require no conversion. +func doesTargetUnitRequireConversion(targetUnitID string) bool { + switch targetUnitID { + case emptyUnitID, autoUnitID, noneUnitID: + return false + default: + return true + } +} + +// applyFoldOrResolutionInf modifies the query to use resolution Inf or a fold such that each metric series returns a single value and returns the current modified query or an error. +func (u *metricsQueryModifier) applyFoldOrResolutionInf(ctx context.Context) (*metrics.Query, error) { + metricDefinition, err := u.getMetricDefinition(ctx) + if err != nil { + return nil, err + } + + if (u.query.GetResolution() == "") && metricDefinition.ResolutionInfSupported { + u.setResolutionToInf = true + return u.getModifiedQuery() + } + + if metricDefinition.DefaultAggregation.Type == AggregationTypeValue { + return nil, &UnableToApplyFoldToValueDefaultAggregationError{} + } + + u.includeFold = true + return u.getModifiedQuery() +} + +// getModifiedQuery gets the modified query with any resolution change, or fold or units conversion. +func (u *metricsQueryModifier) getModifiedQuery() (*metrics.Query, error) { + return metrics.NewQuery(u.getModifiedMetricSelector(), u.query.GetEntitySelector(), u.getModifiedResolution(), u.query.GetMZSelector()) +} + +func (u *metricsQueryModifier) getModifiedMetricSelector() string { + modifiedMetricSelector := u.query.GetMetricSelector() + if u.includeFold { + modifiedMetricSelector = "(" + modifiedMetricSelector + "):fold" + } + + if u.unitsConversionMetricSelectorSuffix != "" { + modifiedMetricSelector = "(" + modifiedMetricSelector + ")" + u.unitsConversionMetricSelectorSuffix + } + return modifiedMetricSelector +} + +func (u *metricsQueryModifier) getModifiedResolution() string { + if u.setResolutionToInf { + return metrics.ResolutionInf + } + return u.query.GetResolution() +} + +func (u *metricsQueryModifier) getMetricDefinition(ctx context.Context) (*MetricDefinition, error) { + if u.metricDefinition != nil { + return u.metricDefinition, nil + } + + metricDefinition, err := u.metricsClient.GetMetricDefinitionByID(ctx, u.query.GetMetricSelector()) + if err != nil { + return nil, err + } + + u.metricDefinition = metricDefinition + return u.metricDefinition, nil +} + +func doesMetricKeySupportToUnitTransformation(metricDefinition *MetricDefinition) bool { + const toUnitTransformation = "toUnit" + + for _, t := range metricDefinition.Transformations { + if t == toUnitTransformation { + return true + } + } + return false +} + +func getConversionMetricSelectorSuffix(metricDefinition *MetricDefinition, targetUnitID string) (string, error) { + sourceUnitID := metricDefinition.Unit + + if shouldDoUnitlessConversion(sourceUnitID) { + return getUnitlessConversionMetricSelectorSuffix(targetUnitID) + } + + if doesMetricKeySupportToUnitTransformation(metricDefinition) { + return getToUnitConversionMetricSelectorSuffix(sourceUnitID, targetUnitID), nil + } + + return getAutoToUnitConversionMetricSelectorSuffix(sourceUnitID, targetUnitID), nil +} + +func shouldDoUnitlessConversion(sourceUnitID string) bool { + switch sourceUnitID { + case countUnitID, unspecifiedUnitID: + return true + + default: + return false + } +} + +func getUnitlessConversionMetricSelectorSuffix(targetUnitID string) (string, error) { + snippet, ok := unitlessConversions[targetUnitID] + if !ok { + return "", &UnknownUnitlessConversionError{unitID: targetUnitID} + } + + return snippet, nil +} + +func getAutoToUnitConversionMetricSelectorSuffix(sourceUnitID, targetUnitID string) string { + return fmt.Sprintf(":auto%s", getToUnitConversionMetricSelectorSuffix(sourceUnitID, targetUnitID)) +} + +func getToUnitConversionMetricSelectorSuffix(sourceUnitID, targetUnitID string) string { + return fmt.Sprintf(":toUnit(%s,%s)", sourceUnitID, targetUnitID) +} diff --git a/internal/dynatrace/metrics_processing.go b/internal/dynatrace/metrics_processing.go index 952aeb907..df48e0ef3 100644 --- a/internal/dynatrace/metrics_processing.go +++ b/internal/dynatrace/metrics_processing.go @@ -7,7 +7,6 @@ import ( "sort" "strings" - "github.com/keptn-contrib/dynatrace-service/internal/sli/metrics" "golang.org/x/exp/maps" ) @@ -129,11 +128,12 @@ func newMetricsProcessingResults(request MetricsClientQueryRequest, results []Me } } +// Request gets the request of the MetricsProcessingResults func (r *MetricsProcessingResults) Request() MetricsClientQueryRequest { return r.request } -// Results gets the results of the MetricsProcessingResult. +// Results gets the results of the MetricsProcessingResults. func (r *MetricsProcessingResults) Results() []MetricsProcessingResult { return r.results } @@ -178,32 +178,32 @@ type MetricsProcessingInterface interface { ProcessRequest(ctx context.Context, request MetricsClientQueryRequest) (*MetricsProcessingResults, error) } -// MetricsProcessing is an implementation of MetricsProcessingInterface offers basic retrieval and processing of metrics. +// MetricsProcessing is an implementation of MetricsProcessingInterface. type MetricsProcessing struct { - client MetricsClientInterface + metricsClient MetricsClientInterface allowOnlyOneResult bool } -// NewMetricsProcessing creates a new MetricsProcessing using the specified client interface. -func NewMetricsProcessing(client MetricsClientInterface) *MetricsProcessing { +// NewMetricsProcessingThatAllowsMultipleResults creates a new MetricsProcessing that allows multiple results using the specified client interface. +func NewMetricsProcessingThatAllowsMultipleResults(metricsClient MetricsClientInterface) *MetricsProcessing { return &MetricsProcessing{ - client: client, + metricsClient: metricsClient, allowOnlyOneResult: false, } } // NewMetricsProcessing creates a new MetricsProcessing that only returns a single result using the specified client interface. // If the query processed returns more than one metric series, i.e. results, an error is returned. -func NewMetricsProcessingThatAllowsOnlyOneResult(client MetricsClientInterface) *MetricsProcessing { +func NewMetricsProcessingThatAllowsOnlyOneResult(metricsClient MetricsClientInterface) *MetricsProcessing { return &MetricsProcessing{ - client: client, + metricsClient: metricsClient, allowOnlyOneResult: true, } } // ProcessRequest queries and processes metrics using the specified request. It checks for a single metric series collection, and transforms each metric series into a result with a name derived from its dimension values. Each metric series must have exactly one value. func (p *MetricsProcessing) ProcessRequest(ctx context.Context, request MetricsClientQueryRequest) (*MetricsProcessingResults, error) { - metricData, err := p.client.GetMetricDataByQuery(ctx, request) + metricData, err := p.metricsClient.GetMetricDataByQuery(ctx, request) if err != nil { return nil, &MetricsQueryFailedError{cause: err} } @@ -298,132 +298,53 @@ func generateResultName(dimensionMap map[string]string) string { return strings.Join(sortedSuffixComponentValues, " ") } -// RetryForSingleValueMetricsProcessingDecorator decorates MetricsProcessing by modifying the request in cases where multiple values are returned. -type RetryForSingleValueMetricsProcessingDecorator struct { - client MetricsClientInterface +// MetricsProcessingDecorator is an implementation of MetricsProcessingInterface. +type MetricsProcessingDecorator struct { + metricsClient MetricsClientInterface + targetUnitID string metricsProcessing MetricsProcessingInterface } -// NewRetryForSingleValueMetricsProcessingDecorator creates a new RetryForSingleValueMetricsProcessingDecorator using the specified client interface and underlying metrics processing interface. -func NewRetryForSingleValueMetricsProcessingDecorator(client MetricsClientInterface, metricsProcessing MetricsProcessingInterface) *RetryForSingleValueMetricsProcessingDecorator { - return &RetryForSingleValueMetricsProcessingDecorator{ - client: client, +// NewRetryForSingleValueMetricsProcessingDecorator creates a MetricsProcessingDecorator that modifies and retries the query to try to obtain a single value for each metric series. +func NewRetryForSingleValueMetricsProcessingDecorator(metricsClient MetricsClientInterface, metricsProcessing MetricsProcessingInterface) *MetricsProcessingDecorator { + return &MetricsProcessingDecorator{ + metricsClient: metricsClient, + targetUnitID: noneUnitID, metricsProcessing: metricsProcessing, } } -// ProcessRequest queries and processes metrics using the specified request. -func (p *RetryForSingleValueMetricsProcessingDecorator) ProcessRequest(ctx context.Context, request MetricsClientQueryRequest) (*MetricsProcessingResults, error) { - resultSet, err := p.metricsProcessing.ProcessRequest(ctx, request) - if err == nil { - return resultSet, nil - } - - var qrmvErrorType *MetricsQueryReturnedMultipleValuesError - if !errors.As(err, &qrmvErrorType) { - return nil, err - } - - modifiedQuery, err := p.modifyQuery(ctx, request.query) - if err != nil { - return nil, fmt.Errorf("could not modify query to produce single value: %w", err) - } - - return p.metricsProcessing.ProcessRequest(ctx, NewMetricsClientQueryRequest(*modifiedQuery, request.timeframe)) -} - -// modifyQuery modifies the supplied metrics query such that it should return a single value for each set of dimension values. -// First, it tries to set resolution to Inf if resolution hasn't already been set and it is supported. Otherwise, it tries to do an auto fold if this wouldn't use value. -// Other cases will produce an error, which should be bubbled up to the user to instruct them to fix their tile or query. -func (p *RetryForSingleValueMetricsProcessingDecorator) modifyQuery(ctx context.Context, existingQuery metrics.Query) (*metrics.Query, error) { - // resolution Inf returning multiple values would indicate a broken API (so unlikely), but check for completeness - if strings.EqualFold(existingQuery.GetResolution(), metrics.ResolutionInf) { - return nil, errors.New("not possible to modify query with resolution Inf") - } - - metricSelector := existingQuery.GetMetricSelector() - metricDefinition, err := p.client.GetMetricDefinitionByID(ctx, metricSelector) - if err != nil { - return nil, fmt.Errorf("failed to get definition for metric: %s", metricSelector) - } - - if metricDefinition.ResolutionInfSupported && (existingQuery.GetResolution() == "") { - return metrics.NewQuery(metricSelector, existingQuery.GetEntitySelector(), metrics.ResolutionInf, existingQuery.GetMZSelector()) - } - - if metricDefinition.DefaultAggregation.Type == AggregationTypeValue { - return nil, errors.New("unable to apply ':fold()' to the metric selector as the default aggregation type is 'value'") - } - - return metrics.NewQuery("("+metricSelector+"):fold()", existingQuery.GetEntitySelector(), existingQuery.GetResolution(), existingQuery.GetMZSelector()) -} - -// ConvertUnitMetricsProcessingDecorator decorates MetricsProcessing by converting the unit of the results. -type ConvertUnitMetricsProcessingDecorator struct { - metricsClient MetricsClientInterface - unitsClient MetricsUnitsClientInterface - targetUnitID string - metricsProcessing MetricsProcessingInterface -} - -// NewConvertUnitMetricsProcessingDecorator creates a new ConvertUnitMetricsProcessingDecorator using the specified client interfaces, target unit ID and underlying metrics processing interface. -func NewConvertUnitMetricsProcessingDecorator(metricsClient MetricsClientInterface, - unitsClient MetricsUnitsClientInterface, - targetUnitID string, - metricsProcessing MetricsProcessingInterface) *ConvertUnitMetricsProcessingDecorator { - return &ConvertUnitMetricsProcessingDecorator{ +// NewConvertUnitsAndRetryForSingleValueMetricsProcessingDecorator creates a MetricsProcessingDecorator that modifies the query to obtain a single value for each metric series converted to the specified unit. +func NewConvertUnitsAndRetryForSingleValueMetricsProcessingDecorator(metricsClient MetricsClientInterface, targetUnitID string, metricsProcessing MetricsProcessingInterface) *MetricsProcessingDecorator { + return &MetricsProcessingDecorator{ metricsClient: metricsClient, - unitsClient: unitsClient, targetUnitID: targetUnitID, metricsProcessing: metricsProcessing, } } -// ProcessRequest queries and processes metrics using the specified request. -func (p *ConvertUnitMetricsProcessingDecorator) ProcessRequest(ctx context.Context, request MetricsClientQueryRequest) (*MetricsProcessingResults, error) { - result, err := p.metricsProcessing.ProcessRequest(ctx, request) +func (p *MetricsProcessingDecorator) ProcessRequest(ctx context.Context, request MetricsClientQueryRequest) (*MetricsProcessingResults, error) { + metricsQueryModifier := newMetricsQueryModifier(p.metricsClient, request.query) + modifiedQuery, err := metricsQueryModifier.applyUnitConversion(ctx, p.targetUnitID) if err != nil { return nil, err } - if !doesTargetUnitRequireConversion(p.targetUnitID) { - return result, nil + results, err := p.metricsProcessing.ProcessRequest(ctx, NewMetricsClientQueryRequest(*modifiedQuery, request.timeframe)) + if err == nil { + return results, nil } - metricSelector := result.request.query.GetMetricSelector() - metricDefinition, err := p.metricsClient.GetMetricDefinitionByID(ctx, metricSelector) - if err != nil { + var qrmvErrorType *MetricsQueryReturnedMultipleValuesError + if !errors.As(err, &qrmvErrorType) { return nil, err } - sourceUnitID := metricDefinition.Unit - if sourceUnitID == p.targetUnitID { - return result, nil - } - - convertedResults := make([]MetricsProcessingResult, len(result.Results())) - for i, r := range result.results { - v, err := p.unitsClient.Convert(ctx, NewMetricsUnitsClientConvertRequest(sourceUnitID, r.value, p.targetUnitID)) - if err != nil { - return nil, err - } - - convertedResults[i] = newMetricsProcessingResult(r.Name(), v) + modifiedQuery, err = metricsQueryModifier.applyFoldOrResolutionInf(ctx) + if err != nil { + return nil, err } - return newMetricsProcessingResults(result.Request(), convertedResults, result.Warnings()), nil -} -const emptyUnitID = "" -const autoUnitID = "auto" -const noneUnitID = "none" - -// doesTargetUnitRequireConversion checks if the target unit ID requires conversion or not. Currently, "Auto" (default empty value and explicit `auto` value) and "None" require no conversion. -func doesTargetUnitRequireConversion(targetUnitID string) bool { - switch targetUnitID { - case emptyUnitID, autoUnitID, noneUnitID: - return false - default: - return true - } + return p.metricsProcessing.ProcessRequest(ctx, NewMetricsClientQueryRequest(*modifiedQuery, request.timeframe)) } diff --git a/internal/dynatrace/metrics_units_client.go b/internal/dynatrace/metrics_units_client.go deleted file mode 100644 index 180efbe32..000000000 --- a/internal/dynatrace/metrics_units_client.go +++ /dev/null @@ -1,154 +0,0 @@ -package dynatrace - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "net/url" - "strconv" -) - -// MetricsUnitsPath is the base endpoint for Metrics Units API -const MetricsUnitsPath = "/api/v2/units" - -// UnitConversionResult is the result of a conversion. -type UnitConversionResult struct { - UnitID string `json:"unitId"` - ResultValue float64 `json:"resultValue"` -} - -const ( - valueKey = "value" - targetUnitKey = "targetUnit" -) - -// MetricsUnitsClientConvertRequest encapsulates the request for the MetricsUnitsClient's Convert method. -type MetricsUnitsClientConvertRequest struct { - sourceUnitID string - value float64 - targetUnitID string -} - -// NewMetricsUnitsClientConvertRequest creates a new MetricsUnitsClientConvertRequest. -func NewMetricsUnitsClientConvertRequest(sourceUnitID string, value float64, targetUnitID string) MetricsUnitsClientConvertRequest { - return MetricsUnitsClientConvertRequest{ - sourceUnitID: sourceUnitID, - value: value, - targetUnitID: targetUnitID, - } -} - -// RequestString encodes MetricsUnitsClientConvertRequest into a request string. -func (q *MetricsUnitsClientConvertRequest) RequestString() string { - queryParameters := newQueryParameters() - queryParameters.add(valueKey, strconv.FormatFloat(q.value, 'f', -1, 64)) - queryParameters.add(targetUnitKey, q.targetUnitID) - - return MetricsUnitsPath + "/" + url.PathEscape(q.sourceUnitID) + "/convert?" + queryParameters.encode() -} - -// MetricsUnitsClientInterface defines functions for the Dynatrace Metrics Units endpoint. -type MetricsUnitsClientInterface interface { - // Convert converts a value between the specified units. - Convert(ctx context.Context, request MetricsUnitsClientConvertRequest) (float64, error) -} - -// MetricsUnitsClient is a client for interacting with Dynatrace Metrics Units endpoint. -type MetricsUnitsClient struct { - client ClientInterface -} - -// NewMetricsUnitsClient creates a new MetricsUnitsClient -func NewMetricsUnitsClient(client ClientInterface) *MetricsUnitsClient { - return &MetricsUnitsClient{ - client: client, - } -} - -// Convert converts a value between the specified units. -func (c *MetricsUnitsClient) Convert(ctx context.Context, request MetricsUnitsClientConvertRequest) (float64, error) { - body, err := c.client.Get(ctx, request.RequestString()) - if err != nil { - return 0, err - } - - var result UnitConversionResult - err = json.Unmarshal(body, &result) - if err != nil { - return 0, err - } - - return result.ResultValue, nil -} - -// EnhancedMetricsUnitsDecorator builds on MetricsUnitsClient by providing local conversion for display units for "Count" and "Unspecified" units. -type EnhancedMetricsUnitsDecorator struct { - baseMetricsUnitsClient MetricsUnitsClientInterface -} - -// NewEnhancedMetricsUnitsDecorator creates a new EnhancedMetricsUnitsDecorator -func NewEnhancedMetricsUnitsDecorator(baseMetricsUnitsClient MetricsUnitsClientInterface) *EnhancedMetricsUnitsDecorator { - return &EnhancedMetricsUnitsDecorator{ - baseMetricsUnitsClient: baseMetricsUnitsClient, - } -} - -// Convert converts a value between the specified units. -func (c *EnhancedMetricsUnitsDecorator) Convert(ctx context.Context, request MetricsUnitsClientConvertRequest) (float64, error) { - if shouldDoLocalConversion(request.sourceUnitID) { - return scaleValueForUnitID(request.value, request.targetUnitID) - } - - return c.baseMetricsUnitsClient.Convert(ctx, request) -} - -func scaleValueForUnitID(value float64, targetUnitID string) (float64, error) { - scaleFactor, err := getScaleFactor(targetUnitID) - if err != nil { - return 0, err - } - - return value / scaleFactor, nil -} - -const ( - kiloUnitID = "Kilo" - millionUnitID = "Million" - billionUnitID = "Billion" - trillionUnitID = "Trillion" -) - -const ( - countUnitID = "Count" - unspecifiedUnitID = "Unspecified" -) - -func shouldDoLocalConversion(sourceUnitID string) bool { - switch sourceUnitID { - case countUnitID, unspecifiedUnitID: - return true - - default: - return false - } -} - -func getScaleFactor(unitID string) (float64, error) { - switch unitID { - case kiloUnitID: - return 1000, nil - - case millionUnitID: - return 1000000, nil - - case billionUnitID: - return 1000000000, nil - - case trillionUnitID: - return 1000000000000, nil - - default: - return 0, errors.New(fmt.Sprintf("unknown unit '%s'", unitID)) - } -} diff --git a/internal/sli/dashboard/metrics_query_processing.go b/internal/sli/dashboard/metrics_query_processing.go index b733ba761..ebda9d01f 100644 --- a/internal/sli/dashboard/metrics_query_processing.go +++ b/internal/sli/dashboard/metrics_query_processing.go @@ -17,32 +17,24 @@ type MetricsQueryProcessing struct { func NewMetricsQueryProcessing(client dynatrace.ClientInterface, targetUnitID string) *MetricsQueryProcessing { metricsClient := dynatrace.NewMetricsClient(client) - unitsClient := dynatrace.NewEnhancedMetricsUnitsDecorator(dynatrace.NewMetricsUnitsClient(client)) + return &MetricsQueryProcessing{ - metricsProcessing: dynatrace.NewConvertUnitMetricsProcessingDecorator( + metricsProcessing: dynatrace.NewConvertUnitsAndRetryForSingleValueMetricsProcessingDecorator( metricsClient, - unitsClient, targetUnitID, - dynatrace.NewRetryForSingleValueMetricsProcessingDecorator( - metricsClient, - dynatrace.NewMetricsProcessing(metricsClient), - ), + dynatrace.NewMetricsProcessingThatAllowsMultipleResults(metricsClient), ), } } func NewMetricsQueryProcessingThatAllowsOnlyOneResult(client dynatrace.ClientInterface, targetUnitID string) *MetricsQueryProcessing { metricsClient := dynatrace.NewMetricsClient(client) - unitsClient := dynatrace.NewMetricsUnitsClient(client) + return &MetricsQueryProcessing{ - metricsProcessing: dynatrace.NewConvertUnitMetricsProcessingDecorator( + metricsProcessing: dynatrace.NewConvertUnitsAndRetryForSingleValueMetricsProcessingDecorator( metricsClient, - unitsClient, targetUnitID, - dynatrace.NewRetryForSingleValueMetricsProcessingDecorator( - metricsClient, - dynatrace.NewMetricsProcessingThatAllowsOnlyOneResult(metricsClient), - ), + dynatrace.NewMetricsProcessingThatAllowsOnlyOneResult(metricsClient), ), } } diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_custom_charting_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_custom_charting_test.go index cbbd83a74..16db2150d 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_custom_charting_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_custom_charting_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/keptn-contrib/dynatrace-service/internal/dynatrace" - "github.com/keptn-contrib/dynatrace-service/internal/test" ) // TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceKeyRequestFilterByAutoTag tests splitting by key service request and filtering by tag. @@ -13,12 +12,12 @@ import ( func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceKeyRequestFilterByAutoTag(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.keyRequest.totalProcessingTime", - fullMetricSelector: "builtin:service.keyRequest.totalProcessingTime:splitBy(\"dt.entity.service_method\"):avg:names", - entitySelector: "type(SERVICE_METHOD),fromRelationships.isServiceMethodOfService(type(SERVICE),tag(\"keptnmanager\"))", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.keyRequest.totalProcessingTime") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.keyRequest.totalProcessingTime:splitBy(\"dt.entity.service_method\"):avg:names").copyWithEntitySelector("type(SERVICE_METHOD),fromRelationships.isServiceMethodOfService(type(SERVICE),tag(\"keptnmanager\"))")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("processing_time_logupload", 2087.646963562753, expectedMetricsRequest), @@ -33,7 +32,7 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceKeyRequest func TestRetrieveMetricsFromDashboardCustomChartingTile_WithSLIButNoSeries(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/sli_name_no_series_test/" - handler := createHandlerForEarlyFailureCustomChartingTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("empty_chart")) } @@ -42,7 +41,7 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_WithSLIButNoSeries(t *te func TestRetrieveMetricsFromDashboardCustomChartingTile_WithSLIAndTwoSeries(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/sli_name_two_series_test/" - handler := createHandlerForEarlyFailureCustomChartingTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("services_response_time_two_series")) } @@ -51,12 +50,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_WithSLIAndTwoSeries(t *t func TestRetrieveMetricsFromDashboardCustomChartingTile_NoSplitByNoFilterBy(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/no_splitby_no_filterby/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():avg:names", - entitySelector: "type(SERVICE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():avg:names").copyWithEntitySelector("type(SERVICE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("service_response_time", 54896.50469568841, expectedMetricsRequest), @@ -70,7 +69,8 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_NoSplitByNoFilterBy(t *t func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceKeyRequestFilterByServiceOfServiceMethod(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_serviceofservicemethod/" - handler := createHandlerForLateFailureCustomChartingTest(t, testDataFolder, "builtin:service.keyRequest.totalProcessingTime") + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.keyRequest.totalProcessingTime") runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("tpt_key_requests_journeyservice")) } @@ -79,12 +79,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceKeyRequest func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceFilterByAutoTag(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/splitby_service_filterby_autotag/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy(\"dt.entity.service\"):avg:names", - entitySelector: "type(SERVICE),tag(\"keptn_managed\")", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy(\"dt.entity.service\"):avg:names").copyWithEntitySelector("type(SERVICE),tag(\"keptn_managed\")")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("services_response_time_splitby_service_filterby_autotags_bookingservice", 357668.85193320084, expectedMetricsRequest), @@ -99,12 +99,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceFilterByAu func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceFilterBySpecificEntity(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy(\"dt.entity.service\"):avg:names", - entitySelector: "type(SERVICE),entityId(\"SERVICE-C6876D601CA5DDFD\")", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy(\"dt.entity.service\"):avg:names").copyWithEntitySelector("type(SERVICE),entityId(\"SERVICE-C6876D601CA5DDFD\")")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("services_response_time_splitby_service_filterby_specificentity", 57974.262650996854, expectedMetricsRequest), @@ -118,19 +118,20 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_SplitByServiceFilterBySp func TestRetrieveMetricsFromDashboardCustomChartingTile_NoSplitByFilterByServiceSoftwareTech(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/no_splitby_filterby_servicesoftwaretech/" - handler := createHandlerForLateFailureCustomChartingTest(t, testDataFolder, "builtin:service.response.time") + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("svc_rt_p95")) } func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_WorkerProcessCount(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:tech.generic.processCount", - fullMetricSelector: "builtin:tech.generic.processCount:splitBy():avg:names", - entitySelector: "type(PROCESS_GROUP_INSTANCE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:tech.generic.processCount") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:tech.generic.processCount:splitBy():avg:names").copyWithEntitySelector("type(PROCESS_GROUP_INSTANCE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("proc_count", 48.89432551431819, expectedMetricsRequest), @@ -142,12 +143,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_WorkerProcessCou func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ResponseTimeP90(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/response_time_p90/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():percentile(90.000000):names", - entitySelector: "type(SERVICE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():percentile(90.000000):names").copyWithEntitySelector("type(SERVICE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("svc_rt_p90", 35007.25927374065, expectedMetricsRequest), @@ -159,12 +160,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ResponseTimeP90( func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ResponseTimeP50(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/response_time_p50/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():percentile(50.000000):names", - entitySelector: "type(SERVICE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():percentile(50.000000):names").copyWithEntitySelector("type(SERVICE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("svc_rt_p50", 1500.1086807956667, expectedMetricsRequest), @@ -176,12 +177,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ResponseTimeP50( func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ProcessMemoryAvg(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/process_memory_avg/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:tech.generic.mem.workingSetSize", - fullMetricSelector: "builtin:tech.generic.mem.workingSetSize:splitBy():avg:names", - entitySelector: "type(PROCESS_GROUP_INSTANCE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:tech.generic.mem.workingSetSize") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:tech.generic.mem.workingSetSize:splitBy():avg:names").copyWithEntitySelector("type(PROCESS_GROUP_INSTANCE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("process_memory", 1480033899.1845968, expectedMetricsRequest), @@ -193,12 +194,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ProcessMemoryAvg func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ProcessCPUAvg(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/process_cpu_avg/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:tech.generic.cpu.usage", - fullMetricSelector: "builtin:tech.generic.cpu.usage:splitBy():avg:names", - entitySelector: "type(PROCESS_GROUP_INSTANCE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:tech.generic.cpu.usage") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:tech.generic.cpu.usage:splitBy():avg:names").copyWithEntitySelector("type(PROCESS_GROUP_INSTANCE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("process_cpu", 14.29287304299379, expectedMetricsRequest), @@ -210,12 +211,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_ProcessCPUAvg(t func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_Throughput(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/throughput/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.requestCount.total", - fullMetricSelector: "builtin:service.requestCount.total:splitBy():value:names", - entitySelector: "type(SERVICE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.requestCount.total") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.requestCount.total:splitBy():value:names").copyWithEntitySelector("type(SERVICE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("svc_tp_min", 2099456590, expectedMetricsRequest), @@ -227,12 +228,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_Throughput(t *te func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_HostCPUUsageAvg(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:host.cpu.usage", - fullMetricSelector: "builtin:host.cpu.usage:splitBy():avg:names", - entitySelector: "type(HOST)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:host.cpu.usage") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:host.cpu.usage:splitBy():avg:names").copyWithEntitySelector("type(HOST)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("host_cpu", 20.41917825744766, expectedMetricsRequest), @@ -244,12 +245,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_HostCPUUsageAvg( func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_HostMemoryUsageAvg(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:host.mem.usage", - fullMetricSelector: "builtin:host.mem.usage:splitBy():avg:names", - entitySelector: "type(HOST)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:host.mem.usage") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:host.mem.usage:splitBy():avg:names").copyWithEntitySelector("type(HOST)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("host_mem", 45.433269610961815, expectedMetricsRequest), @@ -261,12 +262,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_HostMemoryUsageA func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_HostDiskQueueLengthMax(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:host.disk.queueLength", - fullMetricSelector: "builtin:host.disk.queueLength:splitBy():max:names", - entitySelector: "type(HOST)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:host.disk.queueLength") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:host.disk.queueLength:splitBy():max:names").copyWithEntitySelector("type(HOST)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("host_disk_queue", 100, expectedMetricsRequest), @@ -278,12 +279,12 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_HostDiskQueueLen func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_NonDbChildCallCount(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.nonDbChildCallCount", - fullMetricSelector: "builtin:service.nonDbChildCallCount:splitBy():value:names", - entitySelector: "type(SERVICE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.nonDbChildCallCount") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.nonDbChildCallCount:splitBy():value:names").copyWithEntitySelector("type(SERVICE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("svc2svc_calls", 341746808, expectedMetricsRequest), @@ -295,12 +296,14 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_OldTest_NonDbChildCallCo // TestRetrieveMetricsFromDashboardCustomChartingTile_ExcludedTile tests an additional custom charting tile with exclude set to true is skipped. // This results in success, as this is supported. func TestRetrieveMetricsFromDashboardCustomChartingTile_ExcludedTile(t *testing.T) { - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: "./testdata/dashboards/custom_charting/excluded_tile/", - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():avg:names", - entitySelector: "type(SERVICE)", - }) + const testDataFolder = "./testdata/dashboards/custom_charting/excluded_tile/" + + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():avg:names").copyWithEntitySelector("type(SERVICE)")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("service_response_time", 54896.50469568841, expectedMetricsRequest), @@ -314,37 +317,34 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_ExcludedTile(t *testing. func TestRetrieveMetricsFromDashboardCustomChartingTile_UnitTransformMilliseconds(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/unit_transform_milliseconds/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():avg:names", - entitySelector: "type(SERVICE)", - }) - - handler.AddExact(buildMetricsUnitsConvertRequest("MicroSecond", 54896.48858596068, "MilliSecond"), filepath.Join(testDataFolder, "metrics_units_convert1.json")) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():avg:names").copyWithEntitySelector("type(SERVICE)"), + createToUnitConversionSnippet(microSecondUnitID, milliSecondUnitID)) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ - createSuccessfulSLIResultAssertionsFunc("service_response_time", 54.89648858596068, expectedMetricsRequest), + createSuccessfulSLIResultAssertionsFunc("service_response_time", 54.896485186544574, expectedMetricsRequest), } runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, sliResultsAssertionsFuncs...) } -// TestRetrieveMetricsFromDashboardCustomChartingTile_UnitTransformError tests a custom charting tile with invalid units generates the expected error. -func TestRetrieveMetricsFromDashboardCustomChartingTile_UnitTransformError(t *testing.T) { +// TestRetrieveMetricsFromDashboardCustomChartingTile_IncompatibleUnitTransformIsIgnored tests a custom charting tile that performs and incompatible unit transform performs no conversion and still succeeds due to the underlying API. +// This is would require a misconfigured Custom charting tile to occur. +func TestRetrieveMetricsFromDashboardCustomChartingTile_IncompatibleUnitTransformIsIgnored(t *testing.T) { const testDataFolder = "./testdata/dashboards/custom_charting/unit_transform_error/" requestBuilder := newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():avg:names").copyWithEntitySelector("type(SERVICE)") - handler, _ := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: requestBuilder.metricSelector(), - entitySelector: "type(SERVICE)", - }) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") - handler.AddExactError(buildMetricsUnitsConvertRequest("MicroSecond", 54896.48858596068, "Byte"), 400, filepath.Join(testDataFolder, "metrics_units_convert_error.json")) - runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultWithQueryAssertionsFunc("service_response_time", requestBuilder.build())) + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testDataFolder, requestBuilder, createToUnitConversionSnippet(microSecondUnitID, byteUnitID)) + + runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, createSuccessfulSLIResultAssertionsFunc("service_response_time", 54896.485186544574, expectedMetricsRequest)) } // TestRetrieveMetricsFromDashboardCustomChartingTile_ManagementZonesWork tests applying management zones to the dashboard and tile work as expected. @@ -461,7 +461,7 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_ManagementZonesWork(t *t t.Run(tt.name, func(t *testing.T) { handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { DashboardFilterString string TileFilterString string @@ -472,45 +472,9 @@ func TestRetrieveMetricsFromDashboardCustomChartingTile_ManagementZonesWork(t *t ) testVariantDataFolder := filepath.Join(testDataFolder, tt.name) - handler.AddExactFile(buildMetricsV2DefinitionRequestString("builtin:service.response.time"), filepath.Join(testVariantDataFolder, "metrics_get_by_id0.json")) + handler.AddExactFile(buildMetricsV2DefinitionRequestString("builtin:service.response.time"), filepath.Join(testVariantDataFolder, baseMetricsDefinitionFilename)) metricsQueryRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, tt.requestBuilder) runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, createSuccessfulSLIResultAssertionsFunc("service_response_time", tt.expectedSLIValue, metricsQueryRequest)) }) } } - -type successfulCustomChartingTestHandlerConfiguration struct { - testDataFolder string - baseMetricSelector string - fullMetricSelector string - entitySelector string -} - -func createHandlerForSuccessfulCustomChartingTest(t *testing.T, config successfulCustomChartingTestHandlerConfiguration) (*test.FileBasedURLHandler, string) { - handler := test.NewFileBasedURLHandler(t) - handler.AddExact(dynatrace.DashboardsPath+"/"+testDashboardID, filepath.Join(config.testDataFolder, "dashboard.json")) - queryBuilder := newMetricsV2QueryRequestBuilder(config.fullMetricSelector).copyWithEntitySelector(config.entitySelector) - - expectedFirstMetricsRequest := queryBuilder.build() - expectedSecondMetricsRequest := queryBuilder.copyWithResolution(resolutionInf).build() - - handler.AddExact(buildMetricsV2DefinitionRequestString(config.baseMetricSelector), filepath.Join(config.testDataFolder, "metrics_get_by_id_base.json")) - handler.AddExact(buildMetricsV2DefinitionRequestString(config.fullMetricSelector), filepath.Join(config.testDataFolder, "metrics_get_by_id_full.json")) - handler.AddExact(expectedFirstMetricsRequest, filepath.Join(config.testDataFolder, "metrics_get_by_query_first.json")) - handler.AddExact(expectedSecondMetricsRequest, filepath.Join(config.testDataFolder, "metrics_get_by_query_second.json")) - - return handler, expectedSecondMetricsRequest -} - -func createHandlerForEarlyFailureCustomChartingTest(t *testing.T, testDataFolder string) *test.FileBasedURLHandler { - handler := test.NewFileBasedURLHandler(t) - handler.AddExact(dynatrace.DashboardsPath+"/"+testDashboardID, filepath.Join(testDataFolder, "dashboard.json")) - return handler -} - -func createHandlerForLateFailureCustomChartingTest(t *testing.T, testDataFolder string, baseMetricSelector string) *test.FileBasedURLHandler { - handler := test.NewFileBasedURLHandler(t) - handler.AddExact(dynatrace.DashboardsPath+"/"+testDashboardID, filepath.Join(testDataFolder, "dashboard.json")) - handler.AddExact(buildMetricsV2DefinitionRequestString(baseMetricSelector), filepath.Join(testDataFolder, "metrics_get_by_id_base.json")) - return handler -} diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_test.go index e61538ee9..4a7aa9d58 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_test.go @@ -19,7 +19,7 @@ import ( func TestRetrieveMetricsFromDashboardDataExplorerTile_WithSLIButNoQuery(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/sli_name_no_query/" - handler := createHandlerForEarlyFailureDataExplorerTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("new")) } @@ -28,7 +28,7 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_WithSLIButNoQuery(t *testi func TestRetrieveMetricsFromDashboardDataExplorerTile_WithSLIAndTwoQueries(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/sli_name_two_queries/" - handler := createHandlerForEarlyFailureDataExplorerTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("two")) } @@ -130,7 +130,7 @@ func TestRetrieveMetricsFromDashboardDataExplorerTileMetricExpressions_FoldValue handler := createHandlerForWithDashboardForMetricExpressionsTest(t, testDataFolder, graphChartVisualConfigType, &[]string{"resolution=30m&" + metricSelector}) addRequestsToHandlerForSuccessfulMetricsQueryWithFold(handler, testVariantDataFolder, requestBuilder) - runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultWithQueryAssertionsFunc("srt", requestBuilder.build(), "unable to apply ':fold()'")) + runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultWithQueryAssertionsFunc("srt", requestBuilder.build(), "unable to apply ':fold'")) } // TestRetrieveMetricsFromDashboardDataExplorerTileMetricExpressions_Errors tests that invalid metric expressions configurations generate errors as expected. @@ -194,7 +194,7 @@ func TestRetrieveMetricsFromDashboardDataExplorerTileMetricExpressions_Errors(t func createHandlerForWithDashboardForMetricExpressionsTest(t *testing.T, testDataFolder string, visualConfigType string, metricExpressions *[]string) *test.CombinedURLHandler { return createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { VisualConfigType string MetricExpressionsString string @@ -324,7 +324,7 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_ManagementZonesWork(t *tes t.Run(tt.name, func(t *testing.T) { handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { DashboardFilterString string TileFilterString string @@ -342,17 +342,14 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_ManagementZonesWork(t *tes } // TestRetrieveMetricsFromDashboardDataExplorerTile_ManagementZoneWithNoEntityType tests that data explorer tiles with a management zone and no obvious entity type work. -// TODO: 12-10-2022: Update this test once test files are available, as in theory this functionality should work func TestRetrieveMetricsFromDashboardDataExplorerTile_ManagementZoneWithNoEntityType(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/no_entity_type/" - t.Skip() - handler, expectedMetricsRequest := createHandlerForSuccessfulDataExplorerTestWithResolutionInf(t, - testDataFolder, - newMetricsV2QueryRequestBuilder("(builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:auto:sort(value(sum,descending)):limit(100)):limit(100):names").copyWithMZSelector("mzId(2311420533206603714)"), - ) + handler := createHandlerWithDashboard(t, testDataFolder) + expectedMetricsRequest := newMetricsV2QueryRequestBuilder("(builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:sort(value(sum,descending)):fold(avg)):limit(100):names:fold(auto)").copyWithMZSelector("mzName(\"mz-1\")").build() + handler.AddExactFile(expectedMetricsRequest, filepath.Join(testDataFolder, "metrics_get_by_query1.json")) - runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultWithQueryAssertionsFunc("vulnerabilities_high", expectedMetricsRequest)) + runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, createSuccessfulSLIResultAssertionsFunc("vulnerabilities_high", 536.4052024482108, expectedMetricsRequest)) } // TestRetrieveMetricsFromDashboardDataExplorerTile_CustomSLO tests propagation of a customized SLO. @@ -361,10 +358,11 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_ManagementZoneWithNoEntity func TestRetrieveMetricsFromDashboardDataExplorerTile_CustomSLO(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/custom_slo/" - handler, expectedMetricsRequest := createHandlerForSuccessfulDataExplorerTestWithResolutionInf(t, + handler := createHandlerWithDashboard(t, testDataFolder) + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, testDataFolder, - newMetricsV2QueryRequestBuilder("(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names"), - ) + newMetricsV2QueryRequestBuilder("(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("srt", 54896.50455400265, expectedMetricsRequest), @@ -391,10 +389,11 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_CustomSLO(t *testing.T) { func TestRetrieveMetricsFromDashboardDataExplorerTile_ExcludedTile(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/excluded_tile/" - handler, expectedMetricsRequest := createHandlerForSuccessfulDataExplorerTestWithResolutionInf(t, + handler := createHandlerWithDashboard(t, testDataFolder) + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, testDataFolder, - newMetricsV2QueryRequestBuilder("(builtin:service.response.time:filter(and(or(in(\"dt.entity.service\",entitySelector(\"type(service),entityId(~\"SERVICE-C6876D601CA5DDFD~\")\"))))):splitBy(\"dt.entity.service\"):avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names"), - ) + newMetricsV2QueryRequestBuilder("(builtin:service.response.time:filter(and(or(in(\"dt.entity.service\",entitySelector(\"type(service),entityId(~\"SERVICE-C6876D601CA5DDFD~\")\"))))):splitBy(\"dt.entity.service\"):avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createSuccessfulSLIResultAssertionsFunc("rt_jid", 57974.262650996854, expectedMetricsRequest), @@ -497,7 +496,7 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_TileThresholdsWork(t *test t.Run(thresholdTest.name, func(t *testing.T) { handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { TileName string ThresholdsString string @@ -564,7 +563,7 @@ func createNotVisibleThresholds(rule1 dynatrace.VisualizationThresholdRule, rule func TestRetrieveMetricsFromDashboardDataExplorerTile_MultipleTileConfigurationProblems(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/multiple_tile_configuration_problems/" - handler := createHandlerForEarlyFailureDataExplorerTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("srt", "error parsing SLO definition", "tile has 2 queries enabled but only one is supported", "tile has no metric expressions")) } @@ -572,14 +571,15 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_MultipleTileConfigurationP func TestRetrieveMetricsFromDashboardDataExplorerTile_PickCorrectVisualConfigRule(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/pick_correct_visual_config_rule/" - handler, expectedMetricsRequest := createHandlerForSuccessfulDataExplorerTestWithResolutionInf(t, + handler := createHandlerWithDashboard(t, testDataFolder) + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet( + handler, testDataFolder, newMetricsV2QueryRequestBuilder("(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names"), - ) - handler.AddExact(buildMetricsUnitsConvertRequest("MicroSecond", 54896.48858596068, "MilliSecond"), filepath.Join(testDataFolder, "metrics_units_convert1.json")) + createToUnitConversionSnippet(microSecondUnitID, milliSecondUnitID)) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ - createSuccessfulSLIResultAssertionsFunc("srt_milliseconds", 54.89648858596068, expectedMetricsRequest), + createSuccessfulSLIResultAssertionsFunc("srt_milliseconds", 54.896485186544574, expectedMetricsRequest), } runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, sliResultsAssertionsFuncs...) @@ -589,7 +589,7 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_PickCorrectVisualConfigRul func TestRetrieveMetricsFromDashboardDataExplorerTile_TwoMatchingVisualConfigRulesProducesError(t *testing.T) { const testDataFolder = "./testdata/dashboards/data_explorer/error_two_matching_visual_config_rules/" - handler := createHandlerForEarlyFailureDataExplorerTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultAssertionsFunc("srt", "expected one visualization rule for query", "found 2")) } @@ -704,7 +704,7 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_AllowDuplicateNames(t *tes t.Run(tt.name, func(t *testing.T) { handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { TileName1 string TileName2 string @@ -774,29 +774,3 @@ func convertToJSONString[T any](t *testing.T, o T) string { } return string(bytes) } - -func createHandlerWithTemplatedDashboard(t *testing.T, templateFilename string, templatingData interface{}) *test.CombinedURLHandler { - handler := test.NewCombinedURLHandler(t) - handler.AddExactTemplate(dynatrace.DashboardsPath+"/"+testDashboardID, templateFilename, templatingData) - return handler -} - -func createHandlerForEarlyFailureDataExplorerTest(t *testing.T, testDataFolder string) *test.FileBasedURLHandler { - handler := test.NewFileBasedURLHandler(t) - handler.AddExact(dynatrace.DashboardsPath+"/"+testDashboardID, filepath.Join(testDataFolder, "dashboard.json")) - return handler -} - -func createHandlerForSuccessfulDataExplorerTestWithResolutionInf(t *testing.T, testDataFolder string, requestBuilder *metricsV2QueryRequestBuilder) (*test.FileBasedURLHandler, string) { - handler := test.NewFileBasedURLHandler(t) - handler.AddExact(dynatrace.DashboardsPath+"/"+testDashboardID, filepath.Join(testDataFolder, "dashboard.json")) - - expectedMetricsRequest1 := requestBuilder.build() - expectedMetricsRequest2 := requestBuilder.copyWithResolution(resolutionInf).build() - - handler.AddExact(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, "metrics_get_by_id.json")) - handler.AddExact(expectedMetricsRequest1, filepath.Join(testDataFolder, "metrics_get_by_query1.json")) - handler.AddExact(expectedMetricsRequest2, filepath.Join(testDataFolder, "metrics_get_by_query2.json")) - - return handler, expectedMetricsRequest2 -} diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_threshold_parsing_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_threshold_parsing_test.go index 3263e4c89..778919f30 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_threshold_parsing_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_threshold_parsing_test.go @@ -357,7 +357,7 @@ func runTileThresholdRuleParsingTestAndExpectSuccess(t *testing.T, colorTestComp const testDataFolder = "./testdata/dashboards/data_explorer/tile_thresholds_parsing/success" handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { ThresholdValues []*float64 ThresholdColors []string @@ -375,7 +375,7 @@ func runTileThresholdRuleParsingTestAndExpectError(t *testing.T, colorTestCompon const testDataFolder = "./testdata/dashboards/data_explorer/tile_thresholds_parsing/error" handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { ThresholdValues []*float64 ThresholdColors []string diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_units_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_units_test.go index 1c5fe7f37..980769fef 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_units_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_data_explorer_units_test.go @@ -15,17 +15,15 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T ) const ( - autoUnit = "auto" - noneUnit = "none" - milliSecondUnit = "MilliSecond" - microSecondUnit = "MicroSecond" - dayUnit = "Day" - thousandUnit = "Kilo" - millionUnit = "Million" - billionUnit = "Billion" - trillionUnit = "Trillion" - byteUnit = "Byte" - specialUnit = "Special" + autoUnit = "auto" + noneUnit = "none" + dayUnit = "Day" + thousandUnit = "Kilo" + millionUnit = "Million" + billionUnit = "Billion" + trillionUnit = "Trillion" + specialUnit = "Special" + countUnit = "Count" ) const ( @@ -44,17 +42,21 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T unknownUnitSubstring = "unknown unit" ) + const ( + resolutionNull = "null" + resolution10Minutes = "10m" + ) + serviceResponseTimeMetricSelector := "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names" serviceResponseTimeRequestBuilder := newMetricsV2QueryRequestBuilder(serviceResponseTimeMetricSelector) serviceResponseTimeWithNoConversionHandlerSetupFunc := func(handler *test.CombinedURLHandler, testVariantDataFolder string) { addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder) } - const unconvertedServiceResponseTimeValue = 54896.485383423984 + const unconvertedServiceResponseTimeValue = 54896.485186544574 - serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc := createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedServiceResponseTimeValue, serviceResponseTimeRequestBuilder.copyWithResolution(resolutionInf).build()) - serviceResponseTimeFailedNoUnitSLIResultAssertionsFunc := createFailedSLIResultWithQueryAssertionsFunc(sliName, serviceResponseTimeRequestBuilder.build(), noUnitFoundSubstring) - serviceResponseTimeFailedCannotConvertSLIResultAssertionsFunc := createFailedSLIResultWithQueryAssertionsFunc(sliName, serviceResponseTimeRequestBuilder.build(), cannotConvertSubstring) + serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc := toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedServiceResponseTimeValue, serviceResponseTimeRequestBuilder.copyWithResolution(resolutionInf).build())) + serviceResponseTimeFailedNoUnitSLIResultAssertionsFunc := toSlice(createFailedSLIResultWithQueryAssertionsFunc(sliName, serviceResponseTimeRequestBuilder.build(), noUnitFoundSubstring)) const unconvertedNonDbChildCallCountValue = 341746808.0 @@ -64,8 +66,12 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, nonDbChildCallCountRequestBuilder) } - nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc := createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).build()) - nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc := createFailedSLIResultWithQueryAssertionsFunc(sliName, nonDbChildCallCountRequestBuilder.build(), unknownUnitSubstring) + nonDbChildCallCountUnknownUnitHandlerSetupFunc := func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, nonDbChildCallCountRequestBuilder) + } + + nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc := toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).build())) + nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc := toSlice(createFailedSLIResultWithQueryAssertionsFunc(sliName, nonDbChildCallCountRequestBuilder.build(), unknownUnitSubstring)) const unconvertedUnspecifiedUnitValue = 1.0 @@ -75,16 +81,33 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder) } - unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc := createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).build()) - unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc := createFailedSLIResultWithQueryAssertionsFunc(sliName, unspecifiedUnitRequestBuilder.build(), unknownUnitSubstring) + unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc := toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).build())) + unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc := toSlice(createFailedSLIResultWithQueryAssertionsFunc(sliName, unspecifiedUnitRequestBuilder.build(), unknownUnitSubstring)) + + const serviceResponseTimeNoAggregationMetricSelector = "(builtin:service.response.time:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + serviceResponseTimeNoAggregationResolution10MinutesRequestBuilder := newMetricsV2QueryRequestBuilder(serviceResponseTimeNoAggregationMetricSelector).copyWithResolution(resolution10Minutes) + + const openSecurityProblemsMetricSelector = "(builtin:security.securityProblem.open.global:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names" + openSecurityProblemsRequestBuilder := newMetricsV2QueryRequestBuilder(openSecurityProblemsMetricSelector) + + const openSecurityProblemsByTypeMetricSelector = "(builtin:security.securityProblem.open.global:splitBy(Type):sort(value(auto,descending)):limit(20)):limit(100):names" + openSecurityProblemsByTypeRequestBuilder := newMetricsV2QueryRequestBuilder(openSecurityProblemsByTypeMetricSelector) + + const ( + divideByThousandConversionSnippet = "/1000" + divideByMillionConversionSnippet = "/1000000" + divideByBillionConversionSnippet = "/1000000000" + divideByTrillionConversionSnippet = "/1000000000000" + ) tests := []struct { name string unit string metricSelector string + resolution string handlerAdditionalSetupFunc func(handler *test.CombinedURLHandler, testVariantDataFolder string) getSLIFinishedEventAssertionsFunc func(t *testing.T, actual *getSLIFinishedEventData) - sliResultAssertionsFunc func(t *testing.T, actual sliResult) + sliResultAssertionsFuncs []func(t *testing.T, actual sliResult) }{ // service response time (sourceUnitID = MicroSecond) @@ -93,96 +116,101 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T { name: "success_srt_empty", unit: "", + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: serviceResponseTimeWithNoConversionHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, }, { name: "success_srt_auto", unit: autoUnit, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: serviceResponseTimeWithNoConversionHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, }, { name: "success_srt_none", unit: noneUnit, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: serviceResponseTimeWithNoConversionHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, }, { name: "success_srt_microsecond", - unit: microSecondUnit, + unit: microSecondUnitID, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: serviceResponseTimeWithNoConversionHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: serviceResponseTimeNoConversionRequiredSLIResultAssertionsFunc, }, // success cases that require conversion { name: "success_srt_millisecond", - unit: milliSecondUnit, + unit: milliSecondUnitID, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { - addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder) - handler.AddExactFile(buildMetricsUnitsConvertRequest(microSecondUnit, unconvertedServiceResponseTimeValue, milliSecondUnit), filepath.Join(testVariantDataFolder, metricUnitsConvertFileName)) + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder, + createToUnitConversionSnippet(microSecondUnitID, milliSecondUnitID)) }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedServiceResponseTimeValue/microSecondsPerMilliSecond, serviceResponseTimeRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedServiceResponseTimeValue/microSecondsPerMilliSecond, serviceResponseTimeRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(createToUnitConversionSnippet(microSecondUnitID, milliSecondUnitID)).build())), }, { name: "success_srt_day", unit: dayUnit, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { - addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder) - handler.AddExactFile(buildMetricsUnitsConvertRequest(microSecondUnit, unconvertedServiceResponseTimeValue, dayUnit), filepath.Join(testVariantDataFolder, metricUnitsConvertFileName)) + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder, createToUnitConversionSnippet(microSecondUnitID, dayUnit)) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedServiceResponseTimeValue/microSecondsPerDay, serviceResponseTimeRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, 6.353759859553769e-7, serviceResponseTimeRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(createToUnitConversionSnippet(microSecondUnitID, dayUnit)).build())), }, // error cases + { name: "error_srt_byte", - unit: byteUnit, + unit: byteUnitID, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { - addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder) - handler.AddExactError(buildMetricsUnitsConvertRequest(microSecondUnit, unconvertedServiceResponseTimeValue, byteUnit), 400, filepath.Join(testVariantDataFolder, metricUnitsConvertFileName)) + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder, createToUnitConversionSnippet(microSecondUnitID, byteUnitID)) }, - getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: serviceResponseTimeFailedCannotConvertSLIResultAssertionsFunc, + getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedServiceResponseTimeValue, serviceResponseTimeRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(createToUnitConversionSnippet(microSecondUnitID, byteUnitID)).build())), }, { name: "error_srt_thousand", unit: thousandUnit, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { - addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder) - handler.AddExactError(buildMetricsUnitsConvertRequest(microSecondUnit, unconvertedServiceResponseTimeValue, thousandUnit), 400, filepath.Join(testVariantDataFolder, metricUnitsConvertFileName)) - + addRequestsToHandlerForFailedMetricsQueryWithUnitsConversionSnippet(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder, createToUnitConversionSnippet(microSecondUnitID, thousandUnit)) }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: serviceResponseTimeFailedNoUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: serviceResponseTimeFailedNoUnitSLIResultAssertionsFunc, }, { name: "error_srt_special", unit: specialUnit, + resolution: resolutionNull, metricSelector: serviceResponseTimeMetricSelector, handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { - addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder) - handler.AddExactError(buildMetricsUnitsConvertRequest(microSecondUnit, unconvertedServiceResponseTimeValue, specialUnit), 400, filepath.Join(testVariantDataFolder, metricUnitsConvertFileName)) - + addRequestsToHandlerForFailedMetricsQueryWithUnitsConversionSnippet(handler, testVariantDataFolder, serviceResponseTimeRequestBuilder, createToUnitConversionSnippet(microSecondUnitID, specialUnit)) }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: serviceResponseTimeFailedNoUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: serviceResponseTimeFailedNoUnitSLIResultAssertionsFunc, }, // builtin:service.nonDbChildCallCount (sourceUnitID = Count) @@ -192,88 +220,106 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T { name: "success_ndbccc_empty", unit: "", + resolution: resolutionNull, metricSelector: nonDbChildCallCountMetricSelector, handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc, }, { name: "success_ndbccc_auto", unit: autoUnit, + resolution: resolutionNull, metricSelector: nonDbChildCallCountMetricSelector, handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc, }, { name: "success_ndbccc_none", unit: noneUnit, + resolution: resolutionNull, metricSelector: nonDbChildCallCountMetricSelector, handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: nonDbChildCallCountNoConversionRequiredSLIResultAssertionsFunc, }, // success cases where conversion is done by dynatrace-service { - name: "success_ndbccc_thousand", - unit: thousandUnit, - metricSelector: nonDbChildCallCountMetricSelector, - handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, + name: "success_ndbccc_thousand", + unit: thousandUnit, + resolution: resolutionNull, + metricSelector: nonDbChildCallCountMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, nonDbChildCallCountRequestBuilder, divideByThousandConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerThousand, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerThousand, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByThousandConversionSnippet).build())), }, { - name: "success_ndbccc_million", - unit: millionUnit, - metricSelector: nonDbChildCallCountMetricSelector, - handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, + name: "success_ndbccc_million", + unit: millionUnit, + resolution: resolutionNull, + metricSelector: nonDbChildCallCountMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, nonDbChildCallCountRequestBuilder, divideByMillionConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerMillion, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerMillion, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByMillionConversionSnippet).build())), }, { - name: "success_ndbccc_billion", - unit: billionUnit, - metricSelector: nonDbChildCallCountMetricSelector, - handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, + name: "success_ndbccc_billion", + unit: billionUnit, + resolution: resolutionNull, + metricSelector: nonDbChildCallCountMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, nonDbChildCallCountRequestBuilder, divideByBillionConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerBillion, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerBillion, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByBillionConversionSnippet).build())), }, { - name: "success_ndbccc_trillion", - unit: trillionUnit, - metricSelector: nonDbChildCallCountMetricSelector, - handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, + name: "success_ndbccc_trillion", + unit: trillionUnit, + resolution: resolutionNull, + metricSelector: nonDbChildCallCountMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, nonDbChildCallCountRequestBuilder, divideByTrillionConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerTrillion, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedNonDbChildCallCountValue/countPerTrillion, nonDbChildCallCountRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByTrillionConversionSnippet).build())), }, // error cases where no conversion is possible { name: "error_ndbccc_byte", - unit: byteUnit, + unit: byteUnitID, + resolution: resolutionNull, metricSelector: nonDbChildCallCountMetricSelector, - handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, + handlerAdditionalSetupFunc: nonDbChildCallCountUnknownUnitHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc, //createFailedSLIResultWithQueryAssertionsFunc(sliName, nonDbChildCallCountRequestBuilder.build()), }, { name: "error_ndbccc_millisecond", - unit: milliSecondUnit, + unit: milliSecondUnitID, + resolution: resolutionNull, metricSelector: nonDbChildCallCountMetricSelector, - handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, + handlerAdditionalSetupFunc: nonDbChildCallCountUnknownUnitHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc, }, { name: "error_ndbccc_special", unit: specialUnit, + resolution: resolutionNull, metricSelector: nonDbChildCallCountMetricSelector, - handlerAdditionalSetupFunc: nonDbChildCallCountHandlerSetupFunc, + handlerAdditionalSetupFunc: nonDbChildCallCountUnknownUnitHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: nonDbChildCallCountFailedUnknownUnitSLIResultAssertionsFunc, }, // builtin:service.response.time:splitBy() / builtin:service.response.time:splitBy() (sourceUnitID = Unspecified) @@ -283,88 +329,156 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T { name: "success_uum_empty", unit: "", + resolution: resolutionNull, metricSelector: unspecifiedUnitMetricSelector, handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc, }, { name: "success_uum_auto", unit: autoUnit, + resolution: resolutionNull, metricSelector: unspecifiedUnitMetricSelector, handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc, }, { name: "success_uum_none", unit: noneUnit, + resolution: resolutionNull, metricSelector: unspecifiedUnitMetricSelector, handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc, + sliResultAssertionsFuncs: unspecifiedUnitNoConversionRequiredSLIResultAssertionsFunc, }, // success cases where conversion is done by dynatrace-service { - name: "success_uum_thousand", - unit: thousandUnit, - metricSelector: unspecifiedUnitMetricSelector, - handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, + name: "success_uum_thousand", + unit: thousandUnit, + resolution: resolutionNull, + metricSelector: unspecifiedUnitMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder, divideByThousandConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerThousand, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerThousand, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByThousandConversionSnippet).build())), }, { - name: "success_uum_million", - unit: millionUnit, - metricSelector: unspecifiedUnitMetricSelector, - handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, + name: "success_uum_million", + unit: millionUnit, + resolution: resolutionNull, + metricSelector: unspecifiedUnitMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder, divideByMillionConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerMillion, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerMillion, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByMillionConversionSnippet).build())), }, { - name: "success_uum_billion", - unit: billionUnit, - metricSelector: unspecifiedUnitMetricSelector, - handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, + name: "success_uum_billion", + unit: billionUnit, + resolution: resolutionNull, + metricSelector: unspecifiedUnitMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder, divideByBillionConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerBillion, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerBillion, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByBillionConversionSnippet).build())), }, { - name: "success_uum_trillion", - unit: trillionUnit, - metricSelector: unspecifiedUnitMetricSelector, - handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, + name: "success_uum_trillion", + unit: trillionUnit, + resolution: resolutionNull, + metricSelector: unspecifiedUnitMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder, divideByTrillionConversionSnippet) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, - sliResultAssertionsFunc: createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerTrillion, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).build()), + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, unconvertedUnspecifiedUnitValue/countPerTrillion, unspecifiedUnitRequestBuilder.copyWithResolution(resolutionInf).copyWithMetricSelectorConversionSnippet(divideByTrillionConversionSnippet).build())), }, // error cases where no conversion is possible { - name: "error_uum_byte", - unit: byteUnit, - metricSelector: unspecifiedUnitMetricSelector, - handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, + name: "error_uum_byte", + unit: byteUnitID, + resolution: resolutionNull, + metricSelector: unspecifiedUnitMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestToHandlerForMetricDefinition(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc, }, { - name: "error_uum_millisecond", - unit: milliSecondUnit, - metricSelector: unspecifiedUnitMetricSelector, - handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, + name: "error_uum_millisecond", + unit: milliSecondUnitID, + resolution: resolutionNull, + metricSelector: unspecifiedUnitMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestToHandlerForMetricDefinition(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc, }, { - name: "error_uum_special", - unit: specialUnit, - metricSelector: unspecifiedUnitMetricSelector, - handlerAdditionalSetupFunc: unspecifiedUnitHandlerSetupFunc, + name: "error_uum_special", + unit: specialUnit, + resolution: resolutionNull, + metricSelector: unspecifiedUnitMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestToHandlerForMetricDefinition(handler, testVariantDataFolder, unspecifiedUnitRequestBuilder) + }, getSLIFinishedEventAssertionsFunc: getSLIFinishedEventFailureAssertionsFunc, - sliResultAssertionsFunc: unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc, + sliResultAssertionsFuncs: unspecifiedUnitFailedUnknownUnitSLIResultAssertionsFunc, + }, + + // additional test cases + + // fold with toUnit and no aggregation specified + { + name: "success_srt_resolution_10m_millisecond", + unit: milliSecondUnitID, + resolution: resolution10Minutes, + metricSelector: serviceResponseTimeNoAggregationMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithFoldAndUnitsConversionSnippet(handler, testVariantDataFolder, serviceResponseTimeNoAggregationResolution10MinutesRequestBuilder, + createAutoToUnitConversionSnippet(microSecondUnitID, milliSecondUnitID)) + }, + getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, 54.89648587772039, serviceResponseTimeNoAggregationResolution10MinutesRequestBuilder.copyWithFold().copyWithMetricSelectorConversionSnippet(createAutoToUnitConversionSnippet(microSecondUnitID, milliSecondUnitID)).build())), + }, + + // fold with scaling producing a single value + { + name: "success_osp_thousand_single_value", + unit: thousandUnit, + resolution: resolutionNull, + metricSelector: openSecurityProblemsMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithFoldAndUnitsConversionSnippet(handler, testVariantDataFolder, openSecurityProblemsRequestBuilder, divideByThousandConversionSnippet) + }, + getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, + sliResultAssertionsFuncs: toSlice(createSuccessfulSLIResultAssertionsFunc(sliName, 0.07657418459403192, openSecurityProblemsRequestBuilder.copyWithFold().copyWithMetricSelectorConversionSnippet(divideByThousandConversionSnippet).build())), + }, + + // fold with scaling producing multiple values + { + name: "success_osp_thousand_multiple_values", + unit: thousandUnit, + resolution: resolutionNull, + metricSelector: openSecurityProblemsByTypeMetricSelector, + handlerAdditionalSetupFunc: func(handler *test.CombinedURLHandler, testVariantDataFolder string) { + addRequestsToHandlerForSuccessfulMetricsQueryWithFoldAndUnitsConversionSnippet(handler, testVariantDataFolder, openSecurityProblemsByTypeRequestBuilder, divideByThousandConversionSnippet) + }, + getSLIFinishedEventAssertionsFunc: getSLIFinishedEventSuccessAssertionsFunc, + sliResultAssertionsFuncs: toSlice( + createSuccessfulSLIResultAssertionsFunc(sliName+"_third-party_vulnerability", 0.0917177307425399, openSecurityProblemsByTypeRequestBuilder.copyWithFold().copyWithMetricSelectorConversionSnippet(divideByThousandConversionSnippet).build()), + createSuccessfulSLIResultAssertionsFunc(sliName+"_code-level_vulnerability", 0.016, openSecurityProblemsByTypeRequestBuilder.copyWithFold().copyWithMetricSelectorConversionSnippet(divideByThousandConversionSnippet).build())), }, } @@ -372,19 +486,34 @@ func TestRetrieveMetricsFromDashboardDataExplorerTile_UnitTransform(t *testing.T t.Run(tt.name, func(t *testing.T) { handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { Unit string MetricSelector string + Resolution string }{ Unit: tt.unit, MetricSelector: tt.metricSelector, + Resolution: tt.resolution, }) testVariantDataFolder := filepath.Join(testDataFolder, tt.name) tt.handlerAdditionalSetupFunc(handler, testVariantDataFolder) - runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, tt.getSLIFinishedEventAssertionsFunc, tt.sliResultAssertionsFunc) + runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, tt.getSLIFinishedEventAssertionsFunc, tt.sliResultAssertionsFuncs...) }) } } + +func addRequestsToHandlerForFailedMetricsQueryWithUnitsConversionSnippet(handler *test.CombinedURLHandler, testDataFolder string, requestBuilder *metricsV2QueryRequestBuilder, metricSelectorConversionSnippet string) string { + handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, metricsDefinitionFilename)) + + requestBuilderWithUnitsConversionSnippet := requestBuilder.copyWithMetricSelectorConversionSnippet(metricSelectorConversionSnippet) + handler.AddExactError(requestBuilderWithUnitsConversionSnippet.build(), 400, filepath.Join(testDataFolder, metricsQueryFilename1)) + + return requestBuilderWithUnitsConversionSnippet.build() +} + +func toSlice[V any](v ...V) []V { + return v +} diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_problem_tile_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_problem_tile_test.go index b036010ce..dad9e4f45 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_problem_tile_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_problem_tile_test.go @@ -159,7 +159,7 @@ func TestRetrieveMetricsFromDashboardProblemTile_ManagementZonesWork(t *testing. t.Run(tt.name, func(t *testing.T) { handler := createHandlerWithTemplatedDashboard(t, - filepath.Join(testDataFolder, "dashboard.template.json"), + filepath.Join(testDataFolder, dashboardTemplateFilename), struct { DashboardFilterString string TileFilterString string diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_slo_generation_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_slo_generation_test.go index 6b6621751..e463b1bb9 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_slo_generation_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_slo_generation_test.go @@ -14,12 +14,14 @@ import ( func TestRetrieveMetrics_SLOObjectiveGeneratedFromSupportedDataExplorerTile(t *testing.T) { const testDataFolder = "./testdata/dashboards/slo_generation/supported_data_explorer_tile/" - handler, expectedMetricsRequest := createHandlerForSuccessfulDataExplorerTestWithResolutionInf(t, + handler := createHandlerWithDashboard(t, testDataFolder) + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, testDataFolder, newMetricsV2QueryRequestBuilder("(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ - createSuccessfulSLIResultAssertionsFunc("srt", 54896.50447404383, expectedMetricsRequest), + createSuccessfulSLIResultAssertionsFunc("srt", 54896.485186544574, expectedMetricsRequest), } uploadedSLOsAssertionsFunc := func(t *testing.T, actual *keptnapi.ServiceLevelObjectives) { @@ -81,10 +83,9 @@ func TestRetrieveMetrics_SLOObjectiveGeneratedForNoDataFromDataExplorerTile(t *t const testDataFolder = "./testdata/dashboards/slo_generation/data_explorer_tile_no_data/" requestBuilder := newMetricsV2QueryRequestBuilder("(builtin:service.response.time:filter(and(or(in(\"dt.entity.service\",entitySelector(\"type(service),entityId(~\"SERVICE-C33B8A4C73748469~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names") - handler, _ := createHandlerForSuccessfulDataExplorerTestWithResolutionInf(t, - testDataFolder, - requestBuilder, - ) + + handler := createHandlerWithDashboard(t, testDataFolder) + _ = addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler, testDataFolder, requestBuilder) uploadedSLOsAssertionsFunc := func(t *testing.T, actual *keptnapi.ServiceLevelObjectives) { if !assert.NotNil(t, actual) { diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_test.go index fb0253330..3ba5462b8 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_dashboard_test.go @@ -23,15 +23,14 @@ import ( func TestNoErrorIsReturnedWhenSLOFileWritingSucceeds(t *testing.T) { const testDataFolder = "./testdata/dashboards/basic/success/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():percentile(95.000000):names", - entitySelector: "type(SERVICE)", - }, - ) - - runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, createSuccessfulSLIResultAssertionsFunc(testIndicatorResponseTimeP95, 210598.1424830455, expectedMetricsRequest)) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():percentile(95.000000):names").copyWithEntitySelector("type(SERVICE)")) + + runGetSLIsFromDashboardTestAndCheckSLIs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, createSuccessfulSLIResultAssertionsFunc(testIndicatorResponseTimeP95, 210597.99593297063, expectedMetricsRequest)) } // TestErrorIsReturnedWhenSLOFileWritingFails tests that an error is returned if retrieving (a single) SLI from a dashboard works but the upload of the SLO file fails. @@ -45,13 +44,12 @@ func TestErrorIsReturnedWhenSLOFileWritingFails(t *testing.T) { const uploadFailsErrorMessage = "SLO upload failed" - handler, _ := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():percentile(95.000000):names", - entitySelector: "type(SERVICE)", - }, - ) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + _ = addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():percentile(95.000000):names").copyWithEntitySelector("type(SERVICE)")) getSLIFinishedEventAssertionsFunc := func(t *testing.T, actual *getSLIFinishedEventData) { assert.EqualValues(t, keptnv2.ResultFailed, actual.Result) @@ -70,19 +68,18 @@ func TestErrorIsReturnedWhenSLOFileWritingFails(t *testing.T) { func TestThatThereIsNoFallbackToSLIsFromDashboard(t *testing.T) { const testDataFolder = "./testdata/dashboards/basic/no_fallback_to_slis/" - handler, expectedMetricsRequest := createHandlerForSuccessfulCustomChartingTest(t, successfulCustomChartingTestHandlerConfiguration{ - testDataFolder: testDataFolder, - baseMetricSelector: "builtin:service.response.time", - fullMetricSelector: "builtin:service.response.time:splitBy():percentile(95.000000):names", - entitySelector: "type(SERVICE)", - }, - ) + handler := createHandlerWithDashboard(t, testDataFolder) + addRequestToHandlerForBaseMetricDefinition(handler, testDataFolder, "builtin:service.response.time") + expectedMetricsRequest := addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf( + handler, + testDataFolder, + newMetricsV2QueryRequestBuilder("builtin:service.response.time:splitBy():percentile(95.000000):names").copyWithEntitySelector("type(SERVICE)")) uploadedSLOsAssertionsFunc := func(t *testing.T, actual *keptnapi.ServiceLevelObjectives) { assert.NotNil(t, actual) } - runGetSLIsFromDashboardTestAndCheckSLIsAndSLOs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, uploadedSLOsAssertionsFunc, createSuccessfulSLIResultAssertionsFunc(testIndicatorResponseTimeP95, 210598.14198018494, expectedMetricsRequest)) + runGetSLIsFromDashboardTestAndCheckSLIsAndSLOs(t, handler, testGetSLIEventData, getSLIFinishedEventSuccessAssertionsFunc, uploadedSLOsAssertionsFunc, createSuccessfulSLIResultAssertionsFunc(testIndicatorResponseTimeP95, 210597.99593297063, expectedMetricsRequest)) } // TestDashboardThatProducesNoDataProducesError tests retrieving (a single) SLI from a dashboard that returns no data. @@ -260,11 +257,11 @@ func (m *uploadSLOsWillFailConfigClientMock) UploadSLOs(_ context.Context, _ str func TestDashboardWithInformationalSLOWithNoData(t *testing.T) { const testDataFolder = "./testdata/dashboards/basic/no_data_informational_sli/" - handler := createHandlerForEarlyFailureDataExplorerTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) expectedMetricsRequest := newMetricsV2QueryRequestBuilder("(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names").build() - handler.AddExact(expectedMetricsRequest, filepath.Join(testDataFolder, "metrics_get_by_query1.json")) + handler.AddExactFile(expectedMetricsRequest, filepath.Join(testDataFolder, "metrics_get_by_query1.json")) expectedSLORequest := buildSLORequest("7d07efde-b714-3e6e-ad95-08490e2540c4") - handler.AddExact(expectedSLORequest, filepath.Join(testDataFolder, "slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json")) + handler.AddExactFile(expectedSLORequest, filepath.Join(testDataFolder, "slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createFailedSLIResultWithQueryAssertionsFunc("service_response_time", expectedMetricsRequest), @@ -303,11 +300,11 @@ func TestDashboardWithInformationalSLOWithNoData(t *testing.T) { func TestDashboardWithInformationalSLOWithError(t *testing.T) { const testDataFolder = "./testdata/dashboards/basic/error_informational_sli/" - handler := createHandlerForEarlyFailureDataExplorerTest(t, testDataFolder) + handler := createHandlerWithDashboard(t, testDataFolder) expectedMetricsRequest := newMetricsV2QueryRequestBuilder("(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names").build() handler.AddExactError(expectedMetricsRequest, 400, filepath.Join(testDataFolder, "metrics_get_by_query1_error.json")) expectedSLORequest := buildSLORequest("7d07efde-b714-3e6e-ad95-08490e2540c4") - handler.AddExact(expectedSLORequest, filepath.Join(testDataFolder, "slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json")) + handler.AddExactFile(expectedSLORequest, filepath.Join(testDataFolder, "slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json")) sliResultsAssertionsFuncs := []func(t *testing.T, actual sliResult){ createFailedSLIResultWithQueryAssertionsFunc("service_response_time", expectedMetricsRequest), diff --git a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_sli_files_test.go b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_sli_files_test.go index dfc253443..da1c79e11 100644 --- a/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_sli_files_test.go +++ b/internal/sli/get_sli_triggered_event_handler_retrieve_metrics_from_sli_files_test.go @@ -24,7 +24,7 @@ const testCouldNotRetrieveSLODefinitionsSubstring = "could not retrieve SLO defi // - this would have lead to a fallback to default SLIs, but should return an error now. func TestNoDefaultSLIsAreUsedWhenCustomSLIsAreValidYAMLButIndicatorCannotBeMatched(t *testing.T) { // no need to have something here, because we should not send an API request - handler := test.NewFileBasedURLHandler(t) + handler := test.NewEmptyURLHandler(t) // error here in the misspelled indicator: configClient := newConfigClientMockWithSLIsAndSLOs(t, @@ -44,7 +44,7 @@ func TestNoDefaultSLIsAreUsedWhenCustomSLIsAreValidYAMLButIndicatorCannotBeMatch // * the defined SLI is valid YAML, but Dynatrace cannot process the query correctly and returns a 400 error func TestNoDefaultSLIsAreUsedWhenCustomSLIsAreValidYAMLButQueryIsNotValid(t *testing.T) { // error here: metric(s)Selector= - handler := test.NewFileBasedURLHandler(t) + handler := test.NewEmptyURLHandler(t) // error here as well: metric(s)Selector= configClient := newConfigClientMockWithSLIsAndSLOs(t, @@ -64,7 +64,7 @@ func TestNoDefaultSLIsAreUsedWhenCustomSLIsAreValidYAMLButQueryIsNotValid(t *tes // * the defined SLI has errors, so parsing the YAML file would not be possible func TestNoDefaultSLIsAreUsedWhenCustomSLIsAreInvalidYAML(t *testing.T) { // make sure we would not be able to query any metric due to a parsing error - handler := test.NewFileBasedURLHandler(t) + handler := test.NewEmptyURLHandler(t) const errorMessage = "invalid YAML file - some parsing issue" configClient := newConfigClientMockThatErrorsGetSLIs(t, fmt.Errorf(errorMessage)) @@ -536,7 +536,7 @@ func TestGetSLIValueMetricsQuery_NoFoldPossible(t *testing.T) { createTestSLOs(createTestSLOWithPassCriterion(testIndicatorAvailability, "<=100")), ) - runGetSLIsFromFilesTestWithOneIndicatorRequestedAndCheckSLIs(t, handler, configClient, testIndicatorAvailability, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultWithQueryAssertionsFunc(testIndicatorAvailability, expectedMetricsRequest, "unable to apply ':fold()'")) + runGetSLIsFromFilesTestWithOneIndicatorRequestedAndCheckSLIs(t, handler, configClient, testIndicatorAvailability, getSLIFinishedEventFailureAssertionsFunc, createFailedSLIResultWithQueryAssertionsFunc(testIndicatorAvailability, expectedMetricsRequest, "unable to apply ':fold'")) } // TestGetSLIValueMetricsQuery_SuccessWithResolutionInfProvided tests processing of Metrics API v2 results where resolution is explicitly set to Inf in different forms. @@ -623,9 +623,10 @@ func TestGetSLIValueMetricsQuery_SuccessWithOtherResolution(t *testing.T) { newMetricsV2QueryRequestBuilder(tt.metricSelector).copyWithResolution("30m"), ) - configClient := newConfigClientMockWithSLIsAndSLOs(t, map[string]string{ - testIndicator: "metricSelector=" + tt.metricSelector + "&resolution=30m", - }, + configClient := newConfigClientMockWithSLIsAndSLOs(t, + map[string]string{ + testIndicator: "metricSelector=" + tt.metricSelector + "&resolution=30m", + }, createTestSLOs(createTestSLOWithPassCriterion(testIndicator, "<=100")), ) diff --git a/internal/sli/test_helper_test.go b/internal/sli/test_helper_test.go index 801b4736c..16544be67 100644 --- a/internal/sli/test_helper_test.go +++ b/internal/sli/test_helper_test.go @@ -7,7 +7,6 @@ import ( "net/http" "net/url" "path/filepath" - "strconv" "testing" cloudevents "github.com/cloudevents/sdk-go/v2" @@ -43,6 +42,10 @@ const resolutionIsNullKeyValuePair = "resolution=null&" const singleValueVisualConfigType = "SINGLE_VALUE" const graphChartVisualConfigType = "GRAPH_CHART" +const microSecondUnitID = "MicroSecond" +const byteUnitID = "Byte" +const milliSecondUnitID = "MilliSecond" + const ( testErrorSubStringZeroMetricSeriesCollections = "Metrics API v2 returned zero metric series collections" testErrorSubStringZeroMetricSeries = "Metrics API v2 returned zero metric series" @@ -121,12 +124,6 @@ func buildMetricsV2DefinitionRequestString(metricID string) string { return fmt.Sprintf("%s/%s", dynatrace.MetricsPath, url.PathEscape(metricID)) } -// buildMetricsUnitsConvertRequest builds a Metrics Units convert request string with the specified source unit ID, value and target unit ID for use in testing. -func buildMetricsUnitsConvertRequest(sourceUnitID string, value float64, targetUnitID string) string { - vs := strconv.FormatFloat(value, 'f', -1, 64) - return fmt.Sprintf("%s/%s/convert?targetUnit=%s&value=%s", dynatrace.MetricsUnitsPath, url.PathEscape(sourceUnitID), targetUnitID, vs) -} - // buildProblemsV2Request builds a Problems V2 request string with the specified problem selector for use in testing. func buildProblemsV2Request(problemSelector string) string { return fmt.Sprintf("%s?from=%s&problemSelector=%s&to=%s", dynatrace.ProblemsV2Path, convertTimeStringToUnixMillisecondsString(testSLIStart), url.QueryEscape(problemSelector), convertTimeStringToUnixMillisecondsString(testSLIEnd)) @@ -545,7 +542,17 @@ func (b *metricsV2QueryRequestBuilder) copyWithEntitySelector(entitySelector str func (b *metricsV2QueryRequestBuilder) copyWithFold() *metricsV2QueryRequestBuilder { existingMetricSelector := b.metricSelector() values := cloneURLValues(b.values) - values.Set("metricSelector", "("+existingMetricSelector+"):fold()") + values.Set("metricSelector", "("+existingMetricSelector+"):fold") + return &metricsV2QueryRequestBuilder{values: values} +} + +// if the conversion snippet is empty the copy's metric selector is left unchanged. +func (b *metricsV2QueryRequestBuilder) copyWithMetricSelectorConversionSnippet(metricSelectorConversionSnippet string) *metricsV2QueryRequestBuilder { + existingMetricSelector := b.metricSelector() + values := cloneURLValues(b.values) + if metricSelectorConversionSnippet != "" { + values.Set("metricSelector", fmt.Sprintf("(%s)%s", existingMetricSelector, metricSelectorConversionSnippet)) + } return &metricsV2QueryRequestBuilder{values: values} } @@ -579,24 +586,85 @@ func cloneURLValues(values url.Values) url.Values { return clone } +const ( + dashboardFilename = "dashboard.json" + dashboardTemplateFilename = "dashboard.template.json" + baseMetricsDefinitionFilename = "metrics_get_by_id_base.json" + metricsDefinitionFilename = "metrics_get_by_id.json" + metricsQueryFilename1 = "metrics_get_by_query1.json" + metricsQueryFilename2 = "metrics_get_by_query2.json" +) + +func createHandlerWithDashboard(t *testing.T, testDataFolder string) *test.CombinedURLHandler { + handler := test.NewCombinedURLHandler(t) + handler.AddExactFile(dynatrace.DashboardsPath+"/"+testDashboardID, filepath.Join(testDataFolder, dashboardFilename)) + return handler +} + +func createHandlerWithTemplatedDashboard(t *testing.T, templateFilename string, templatingData interface{}) *test.CombinedURLHandler { + handler := test.NewCombinedURLHandler(t) + handler.AddExactTemplate(dynatrace.DashboardsPath+"/"+testDashboardID, templateFilename, templatingData) + return handler +} + +func addRequestToHandlerForMetricDefinition(handler *test.CombinedURLHandler, testDataFolder string, requestBuilder *metricsV2QueryRequestBuilder) { + handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, metricsDefinitionFilename)) +} + func addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInf(handler *test.CombinedURLHandler, testDataFolder string, requestBuilder *metricsV2QueryRequestBuilder) string { - expectedMetricsRequest1 := requestBuilder.build() - expectedMetricsRequest2 := requestBuilder.copyWithResolution(resolutionInf).build() + handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, metricsDefinitionFilename)) - handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, "metrics_get_by_id.json")) - handler.AddExactFile(expectedMetricsRequest1, filepath.Join(testDataFolder, "metrics_get_by_query1.json")) - handler.AddExactFile(expectedMetricsRequest2, filepath.Join(testDataFolder, "metrics_get_by_query2.json")) + handler.AddExactFile(requestBuilder.build(), filepath.Join(testDataFolder, metricsQueryFilename1)) - return expectedMetricsRequest2 + requestBuilderWithResolutionInf := requestBuilder.copyWithResolution(resolutionInf) + handler.AddExactFile(requestBuilderWithResolutionInf.build(), filepath.Join(testDataFolder, metricsQueryFilename2)) + + return requestBuilderWithResolutionInf.build() +} + +func addRequestsToHandlerForSuccessfulMetricsQueryWithResolutionInfAndUnitsConversionSnippet(handler *test.CombinedURLHandler, testDataFolder string, requestBuilder *metricsV2QueryRequestBuilder, metricSelectorConversionSnippet string) string { + handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, metricsDefinitionFilename)) + + requestBuilderWithConversionSnippet := requestBuilder.copyWithMetricSelectorConversionSnippet(metricSelectorConversionSnippet) + handler.AddExactFile(requestBuilderWithConversionSnippet.build(), filepath.Join(testDataFolder, metricsQueryFilename1)) + + requestBuilderWithConversionSnippetAndResolutionInf := requestBuilderWithConversionSnippet.copyWithResolution(resolutionInf) + handler.AddExactFile(requestBuilderWithConversionSnippetAndResolutionInf.build(), filepath.Join(testDataFolder, metricsQueryFilename2)) + + return requestBuilderWithConversionSnippetAndResolutionInf.build() } func addRequestsToHandlerForSuccessfulMetricsQueryWithFold(handler *test.CombinedURLHandler, testDataFolder string, requestBuilder *metricsV2QueryRequestBuilder) string { - expectedMetricsRequest1 := requestBuilder.build() - expectedMetricsRequest2 := requestBuilder.copyWithFold().build() + handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, metricsDefinitionFilename)) + + handler.AddExactFile(requestBuilder.build(), filepath.Join(testDataFolder, metricsQueryFilename1)) + + requestBuilderWithFold := requestBuilder.copyWithFold() + handler.AddExactFile(requestBuilderWithFold.build(), filepath.Join(testDataFolder, metricsQueryFilename2)) + + return requestBuilderWithFold.build() +} + +func addRequestToHandlerForBaseMetricDefinition(handler *test.CombinedURLHandler, testDataFolder string, baseMetricSelector string) { + handler.AddExactFile(buildMetricsV2DefinitionRequestString(baseMetricSelector), filepath.Join(testDataFolder, baseMetricsDefinitionFilename)) +} + +func addRequestsToHandlerForSuccessfulMetricsQueryWithFoldAndUnitsConversionSnippet(handler *test.CombinedURLHandler, testDataFolder string, requestBuilder *metricsV2QueryRequestBuilder, metricSelectorConversionSnippet string) string { + handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, metricsDefinitionFilename)) + + requestBuilderWithConversionSnippet := requestBuilder.copyWithMetricSelectorConversionSnippet(metricSelectorConversionSnippet) + handler.AddExactFile(requestBuilderWithConversionSnippet.build(), filepath.Join(testDataFolder, metricsQueryFilename1)) - handler.AddExactFile(buildMetricsV2DefinitionRequestString(requestBuilder.metricSelector()), filepath.Join(testDataFolder, "metrics_get_by_id.json")) - handler.AddExactFile(expectedMetricsRequest1, filepath.Join(testDataFolder, "metrics_get_by_query1.json")) - handler.AddExactFile(expectedMetricsRequest2, filepath.Join(testDataFolder, "metrics_get_by_query2.json")) + requestBuilderWithConversionSnippetAndFold := requestBuilder.copyWithFold().copyWithMetricSelectorConversionSnippet(metricSelectorConversionSnippet) + handler.AddExactFile(requestBuilderWithConversionSnippetAndFold.build(), filepath.Join(testDataFolder, metricsQueryFilename2)) + + return requestBuilderWithConversionSnippetAndFold.build() +} + +func createToUnitConversionSnippet(sourceUnitID, targetUnitID string) string { + return fmt.Sprintf(":toUnit(%s,%s)", sourceUnitID, targetUnitID) +} - return expectedMetricsRequest2 +func createAutoToUnitConversionSnippet(sourceUnitID, targetUnitID string) string { + return fmt.Sprintf(":auto%s", createToUnitConversionSnippet(sourceUnitID, targetUnitID)) } diff --git a/internal/sli/testdata/dashboards/basic/dashboard_query/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json b/internal/sli/testdata/dashboards/basic/dashboard_query/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json index 39141211e..2f9b796f9 100644 --- a/internal/sli/testdata/dashboards/basic/dashboard_query/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json +++ b/internal/sli/testdata/dashboards/basic/dashboard_query/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json @@ -1,30 +1 @@ -{ - "id": "7d07efde-b714-3e6e-ad95-08490e2540c4", - "enabled": true, - "name": "Static SLO - Pass", - "evaluatedPercentage": 95.0, - "errorBudget": 80.0, - "status": "SUCCESS", - "error": "NONE", - "errorBudgetBurnRate": { - "burnRateVisualizationEnabled": false - }, - "metricKey": "func:slo.static_slo___pass", - "burnRateMetricKey": "func:slo.errorBudgetBurnRate.static_slo___pass", - "errorBudgetMetricKey": "func:slo.errorBudget.static_slo___pass", - "normalizedErrorBudgetMetricKey": "func:slo.normalizedErrorBudget.static_slo___pass", - "metricExpression": "(builtin:service.cpu.time:splitBy())*0+95", - "target": 75.0, - "warning": 90.0, - "evaluationType": "AGGREGATE", - "timeframe": "1664323200000 to 1664409600000", - "filter": "type(\"SERVICE\")", - "relatedOpenProblems": 0, - "relatedTotalProblems": 74, - "metricRate": "", - "numeratorValue": 0.0, - "metricNumerator": "", - "useRateMetric": true, - "metricDenominator": "", - "denominatorValue": 0.0 -} +{"id":"7d07efde-b714-3e6e-ad95-08490e2540c4","enabled":true,"name":"Static SLO - Pass","evaluatedPercentage":95.0,"errorBudget":80.0,"status":"SUCCESS","error":"NONE","errorBudgetBurnRate":{"burnRateVisualizationEnabled":false},"metricKey":"func:slo.static_slo___pass","burnRateMetricKey":"func:slo.errorBudgetBurnRate.static_slo___pass","errorBudgetMetricKey":"func:slo.errorBudget.static_slo___pass","normalizedErrorBudgetMetricKey":"func:slo.normalizedErrorBudget.static_slo___pass","metricExpression":"(builtin:service.cpu.time:splitBy())*0+95","target":75.0,"warning":90.0,"evaluationType":"AGGREGATE","timeframe":"1664323200000 to 1664409600000","filter":"type(\"SERVICE\")","relatedOpenProblems":0,"relatedTotalProblems":31,"metricRate":"","metricNumerator":"","metricDenominator":"","numeratorValue":0.0,"denominatorValue":0.0,"useRateMetric":true} \ No newline at end of file diff --git a/internal/sli/testdata/dashboards/basic/error_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json b/internal/sli/testdata/dashboards/basic/error_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json index 8107fbba1..7122637d1 100644 --- a/internal/sli/testdata/dashboards/basic/error_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json +++ b/internal/sli/testdata/dashboards/basic/error_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json @@ -20,11 +20,11 @@ "timeframe": "1664323200000 to 1664409600000", "filter": "type(\"SERVICE\")", "relatedOpenProblems": 0, - "relatedTotalProblems": 35, + "relatedTotalProblems": 31, "metricRate": "", "metricNumerator": "", - "numeratorValue": 0.0, - "useRateMetric": true, "metricDenominator": "", - "denominatorValue": 0.0 + "numeratorValue": 0.0, + "denominatorValue": 0.0, + "useRateMetric": true } diff --git a/internal/sli/testdata/dashboards/basic/no_data/metric_definition_service-response-time.json b/internal/sli/testdata/dashboards/basic/no_data/metric_definition_service-response-time.json index 4cac03f6e..273a69c57 100644 --- a/internal/sli/testdata/dashboards/basic/no_data/metric_definition_service-response-time.json +++ b/internal/sli/testdata/dashboards/basic/no_data/metric_definition_service-response-time.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665582525258, + "lastWritten": 1674660323093, "entityType": [ "SERVICE" ], @@ -49,6 +49,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true } diff --git a/internal/sli/testdata/dashboards/basic/no_data/response_time_p95_200_0_results.json b/internal/sli/testdata/dashboards/basic/no_data/response_time_p95_200_0_results.json index 02fb01518..8a1e349e2 100644 --- a/internal/sli/testdata/dashboards/basic/no_data/response_time_p95_200_0_results.json +++ b/internal/sli/testdata/dashboards/basic/no_data/response_time_p95_200_0_results.json @@ -1,7 +1,7 @@ { "totalCount": 0, "nextPageKey": null, - "resolution": "10m", + "resolution": "1h", "result": [ { "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", diff --git a/internal/sli/testdata/dashboards/basic/no_data_informational_sli/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/basic/no_data_informational_sli/metrics_get_by_query1.json index 71a3f8405..9250c1864 100644 --- a/internal/sli/testdata/dashboards/basic/no_data_informational_sli/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/basic/no_data_informational_sli/metrics_get_by_query1.json @@ -7,7 +7,7 @@ "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", "dataPointCountRatio": 0.0, "dimensionCountRatio": 0.0, - "data": [ ] + "data": [] } ] } diff --git a/internal/sli/testdata/dashboards/basic/no_data_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json b/internal/sli/testdata/dashboards/basic/no_data_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json index 8107fbba1..7aa81c001 100644 --- a/internal/sli/testdata/dashboards/basic/no_data_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json +++ b/internal/sli/testdata/dashboards/basic/no_data_informational_sli/slo_7d07efde-b714-3e6e-ad95-08490e2540c4.json @@ -20,11 +20,11 @@ "timeframe": "1664323200000 to 1664409600000", "filter": "type(\"SERVICE\")", "relatedOpenProblems": 0, - "relatedTotalProblems": 35, + "relatedTotalProblems": 31, + "denominatorValue": 0.0, + "useRateMetric": true, "metricRate": "", "metricNumerator": "", - "numeratorValue": 0.0, - "useRateMetric": true, "metricDenominator": "", - "denominatorValue": 0.0 + "numeratorValue": 0.0 } diff --git a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id.json similarity index 94% rename from internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id.json index 49e8e3401..4f74016e5 100644 --- a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id_full.json +++ b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665581741296, + "lastWritten": 1674660323093, "entityType": [ "SERVICE" ], @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id_base.json b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id_base.json index fbc3d8420..273a69c57 100644 --- a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id_base.json +++ b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id_base.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665582222736, + "lastWritten": 1674660323093, "entityType": [ "SERVICE" ], @@ -49,6 +49,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true } diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_byte/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query1.json similarity index 54% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_byte/metrics_get_by_query1.json rename to internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query1.json index f60c9084d..920b92700 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_byte/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 + 209754.67897924627, + 210382.3698566705, + 210096.02371519656, + 210145.71932329127, + 209982.09594581177, + 210078.28041480374, + 210137.7478865089, + 210102.07537525048, + 210267.94278219133, + 210337.25305454544, + 210683.44823003781, + 210555.66881491194, + 210329.5646584976, + 210941.84486575736, + 210803.89510732974, + 210051.87395936612, + 211011.2815061302, + 209994.70923334372, + 209825.6014190335, + 209826.28781901207, + 210507.27925092273, + 210474.32083545945, + 210008.68648564856, + 209738.0251655389 ] } ] diff --git a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query2.json similarity index 79% rename from internal/sli/testdata/dashboards/basic/success/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query2.json index 2d8c0d34a..b97ddfd21 100644 --- a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query_second.json +++ b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", - "dataPointCountRatio": 2.4155E-4, - "dimensionCountRatio": 0.04831, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 210598.1424830455 + 210597.99593297063 ] } ] diff --git a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query_first.json deleted file mode 100644 index 1c7787ce9..000000000 --- a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query_first.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "10m", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", - "dataPointCountRatio": 0.0695808, - "dimensionCountRatio": 0.04832, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, - 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, - 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, - 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, - 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, - 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, - 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, - 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, - 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, - 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, - 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, - 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, - 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, - 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, - 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, - 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, - 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, - 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, - 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, - 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, - 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, - 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, - 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, - 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, - 1664409600000 - ], - "values": [ - 208672.32770852646, - 209699.9702753503, - 209668.8748441128, - 209861.37754233685, - 209297.74838242694, - 209403.3187212009, - 210040.83770896983, - 210857.1941068705, - 209825.78646078997, - 209408.62977009075, - 209996.81242633908, - 210085.86684180325, - 209670.38378932368, - 209288.03164970796, - 209142.5347089089, - 211578.59508603052, - 208871.54360710617, - 210170.4835503272, - 209507.67441385935, - 209878.3666956971, - 210811.13291869307, - 209488.09041324316, - 209426.4045836794, - 209418.44071289126, - 209755.89759194417, - 209811.72842837757, - 209753.89647271868, - 209776.5227863454, - 209219.31732346443, - 209341.80933132127, - 209606.08393758812, - 210025.1902127797, - 210178.96918174214, - 209153.4624049807, - 209568.11168912178, - 209626.68832728674, - 209473.0146277124, - 209765.0623971166, - 209999.9276541881, - 209482.44329175388, - 210003.31920550333, - 210000.1373512753, - 209497.7465955148, - 209703.77016311247, - 209755.99996242253, - 209606.89585622677, - 210030.678461667, - 209536.91600574946, - 210237.75525672067, - 209656.60664025295, - 209398.7478564765, - 210067.86746823895, - 209897.09427103377, - 210020.36248073546, - 210038.39313800723, - 209892.1894473106, - 209835.25597143418, - 210273.61348731394, - 210073.15594932824, - 209711.90705277745, - 209807.72539692037, - 209337.38752386876, - 210937.2176169452, - 210450.6147262442, - 211544.2948944352, - 209925.14929617, - 211158.49568151485, - 209891.18190932588, - 208870.59677230412, - 210052.8916537282, - 211629.91517208362, - 209575.68450640282, - 210002.18977769677, - 209195.01311380262, - 209815.55541911034, - 209900.41630612695, - 210976.63408144715, - 209649.94604224118, - 209942.01723497245, - 210205.65076515498, - 209271.0392897198, - 213351.9861041029, - 210247.26299533976, - 210594.9361077169, - 209185.94721334736, - 210182.80065665772, - 215659.8063286464, - 210027.7130234052, - 209319.32330954509, - 208101.2237929332, - 208162.21272714835, - 210165.77441030444, - 211072.04163240467, - 210104.59702903414, - 208629.04005961417, - 209752.83297614046, - 210475.15283129475, - 210147.06550911537, - 210842.33404011838, - 211675.58449661444, - 210649.19355354935, - 210327.09928161887, - 210983.2888500684, - 208934.37832576697, - 208862.4418872454, - 208841.85878989424, - 209569.8488536328, - 210477.27663141268, - 209277.79484958266, - 210199.23538059017, - 208485.99249868075, - 209759.8796501344, - 209665.9088091727, - 209348.329534732, - 209350.36644353435, - 210057.187634407, - 209319.89687701926, - 208873.4546676195, - 209633.40834710267, - 209449.82362765417, - 210508.3918094066, - 210288.6596224489, - 209427.52951589925, - 209705.93684276557, - 210151.64733212045, - 210594.39887048368, - 208842.8179202417, - 209631.35310541585, - 210008.42426473138, - 210355.1532891372, - 209693.59675222257, - 212300.26944956745, - 210630.58431600456, - 210326.22473285598, - 209506.0562796084, - 209596.99541708373, - 208673.50809774705, - 209123.50637360165, - 209513.1928787636, - 208960.30563021582, - 208742.55218027497, - 209562.5650152579, - 208887.98695601156, - 210541.3111922813 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id.json similarity index 94% rename from internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id.json index d9c829a24..4f74016e5 100644 --- a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_id_full.json +++ b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665582222736, + "lastWritten": 1674660323093, "entityType": [ "SERVICE" ], @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id_base.json b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id_base.json index 60413fa2c..273a69c57 100644 --- a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id_base.json +++ b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_id_base.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665581711359, + "lastWritten": 1674660323093, "entityType": [ "SERVICE" ], @@ -49,6 +49,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true } diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_special/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query1.json similarity index 54% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_special/metrics_get_by_query1.json rename to internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query1.json index f60c9084d..920b92700 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_special/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 + 209754.67897924627, + 210382.3698566705, + 210096.02371519656, + 210145.71932329127, + 209982.09594581177, + 210078.28041480374, + 210137.7478865089, + 210102.07537525048, + 210267.94278219133, + 210337.25305454544, + 210683.44823003781, + 210555.66881491194, + 210329.5646584976, + 210941.84486575736, + 210803.89510732974, + 210051.87395936612, + 211011.2815061302, + 209994.70923334372, + 209825.6014190335, + 209826.28781901207, + 210507.27925092273, + 210474.32083545945, + 210008.68648564856, + 209738.0251655389 ] } ] diff --git a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query2.json similarity index 79% rename from internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query2.json index 2d8c0d34a..b97ddfd21 100644 --- a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query_second.json +++ b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", - "dataPointCountRatio": 2.4155E-4, - "dimensionCountRatio": 0.04831, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 210598.1424830455 + 210597.99593297063 ] } ] diff --git a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query_first.json deleted file mode 100644 index 9227d18f7..000000000 --- a/internal/sli/testdata/dashboards/basic/slo_writing_fails/metrics_get_by_query_first.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "10m", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", - "dataPointCountRatio": 0.0695664, - "dimensionCountRatio": 0.04831, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, - 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, - 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, - 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, - 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, - 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, - 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, - 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, - 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, - 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, - 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, - 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, - 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, - 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, - 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, - 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, - 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, - 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, - 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, - 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, - 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, - 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, - 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, - 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, - 1664409600000 - ], - "values": [ - 208672.32770852646, - 209699.9702753503, - 209668.8748441128, - 209861.37754233685, - 209297.74838242694, - 209403.3187212009, - 210040.83770896983, - 210857.1941068705, - 209825.78646078997, - 209408.62977009075, - 209996.81242633908, - 210085.86684180325, - 209670.38378932368, - 209288.03164970796, - 209142.5347089089, - 211578.59508603052, - 208871.54360710617, - 210170.4835503272, - 209507.67441385935, - 209878.3666956971, - 210811.13291869307, - 209488.09041324316, - 209426.4045836794, - 209418.44071289126, - 209755.89759194417, - 209811.72842837757, - 209753.89647271868, - 209776.5227863454, - 209219.31732346443, - 209341.80933132127, - 209606.08393758812, - 210025.1902127797, - 210178.96918174214, - 209153.4624049807, - 209568.11168912178, - 209626.68832728674, - 209473.0146277124, - 209765.0623971166, - 209999.9276541881, - 209482.44329175388, - 210003.31920550333, - 210000.1373512753, - 209497.7465955148, - 209703.77016311247, - 209755.99996242253, - 209606.89585622677, - 210030.678461667, - 209536.91600574946, - 210237.75525672067, - 209656.60664025295, - 209398.7478564765, - 210067.86746823895, - 209897.09427103377, - 210020.36248073546, - 210038.39313800723, - 209892.1894473106, - 209835.25597143418, - 210273.61348731394, - 210073.15594932824, - 209711.90705277745, - 209807.72539692037, - 209337.38752386876, - 210937.2176169452, - 210450.6147262442, - 211544.2948944352, - 209925.14929617, - 211158.49568151485, - 209891.18190932588, - 208870.59677230412, - 210052.8916537282, - 211629.91517208362, - 209575.68450640282, - 210002.18977769677, - 209195.01311380262, - 209815.55541911034, - 209900.41630612695, - 210976.63408144715, - 209649.94604224118, - 209942.01723497245, - 210205.65076515498, - 209271.0392897198, - 213351.9861041029, - 210247.35906245033, - 210594.9361077169, - 209185.94721334736, - 210182.80065665772, - 215659.8063286464, - 210027.7130234052, - 209319.32330954509, - 208101.2237929332, - 208162.21272714835, - 210165.77441030444, - 211072.04163240467, - 210104.59702903414, - 208629.04005961417, - 209752.83297614046, - 210475.15283129475, - 210147.06550911537, - 210842.33404011838, - 211675.58449661444, - 210649.19355354935, - 210327.09928161887, - 210983.2888500684, - 208934.37832576697, - 208862.4418872454, - 208841.85878989424, - 209569.8488536328, - 210477.27663141268, - 209277.79484958266, - 210199.23538059017, - 208485.99249868075, - 209759.8796501344, - 209665.9088091727, - 209348.329534732, - 209350.36644353435, - 210057.187634407, - 209319.89687701926, - 208873.4546676195, - 209633.40834710267, - 209449.82362765417, - 210508.3918094066, - 210288.6596224489, - 209427.52951589925, - 209705.93684276557, - 210151.64733212045, - 210594.39887048368, - 208842.8179202417, - 209631.35310541585, - 210008.42426473138, - 210355.1532891372, - 209693.59675222257, - 212300.26944956745, - 210630.58431600456, - 210326.22473285598, - 209506.0562796084, - 209596.99541708373, - 208673.50809774705, - 209123.50637360165, - 209513.1928787636, - 208960.30563021582, - 208742.55218027497, - 209562.5650152579, - 208887.98695601156, - 210541.3111922813 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id.json similarity index 94% rename from internal/sli/testdata/dashboards/basic/success/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/basic/success/metrics_get_by_id.json index 016c2279d..4f74016e5 100644 --- a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id_full.json +++ b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665581531359, + "lastWritten": 1674660323093, "entityType": [ "SERVICE" ], @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id_base.json b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id_base.json index 42ef6a4d6..273a69c57 100644 --- a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id_base.json +++ b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_id_base.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665581494782, + "lastWritten": 1674660323093, "entityType": [ "SERVICE" ], @@ -49,6 +49,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true } diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query1.json similarity index 51% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_query1.json rename to internal/sli/testdata/dashboards/basic/success/metrics_get_by_query1.json index 4d043a386..920b92700 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 14233754, - 14258882, - 14199668, - 14254956, - 14250858, - 14258586, - 14244492, - 14249772, - 14273600, - 14248220, - 14149350, - 14232167, - 14233523, - 14302359, - 14366900, - 14160977, - 14191227, - 14156832, - 14250061, - 14258826, - 14361479, - 14113492, - 14286028, - 14210799 + 209754.67897924627, + 210382.3698566705, + 210096.02371519656, + 210145.71932329127, + 209982.09594581177, + 210078.28041480374, + 210137.7478865089, + 210102.07537525048, + 210267.94278219133, + 210337.25305454544, + 210683.44823003781, + 210555.66881491194, + 210329.5646584976, + 210941.84486575736, + 210803.89510732974, + 210051.87395936612, + 211011.2815061302, + 209994.70923334372, + 209825.6014190335, + 209826.28781901207, + 210507.27925092273, + 210474.32083545945, + 210008.68648564856, + 209738.0251655389 ] } ] diff --git a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query2.json similarity index 79% rename from internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/basic/success/metrics_get_by_query2.json index b86b8c3b6..b97ddfd21 100644 --- a/internal/sli/testdata/dashboards/basic/no_fallback_to_slis/metrics_get_by_query_second.json +++ b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", - "dataPointCountRatio": 2.416E-4, - "dimensionCountRatio": 0.04832, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 210598.14198018494 + 210597.99593297063 ] } ] diff --git a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query_first.json deleted file mode 100644 index 9227d18f7..000000000 --- a/internal/sli/testdata/dashboards/basic/success/metrics_get_by_query_first.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "10m", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy():percentile(95.0):names", - "dataPointCountRatio": 0.0695664, - "dimensionCountRatio": 0.04831, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, - 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, - 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, - 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, - 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, - 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, - 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, - 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, - 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, - 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, - 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, - 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, - 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, - 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, - 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, - 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, - 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, - 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, - 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, - 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, - 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, - 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, - 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, - 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, - 1664409600000 - ], - "values": [ - 208672.32770852646, - 209699.9702753503, - 209668.8748441128, - 209861.37754233685, - 209297.74838242694, - 209403.3187212009, - 210040.83770896983, - 210857.1941068705, - 209825.78646078997, - 209408.62977009075, - 209996.81242633908, - 210085.86684180325, - 209670.38378932368, - 209288.03164970796, - 209142.5347089089, - 211578.59508603052, - 208871.54360710617, - 210170.4835503272, - 209507.67441385935, - 209878.3666956971, - 210811.13291869307, - 209488.09041324316, - 209426.4045836794, - 209418.44071289126, - 209755.89759194417, - 209811.72842837757, - 209753.89647271868, - 209776.5227863454, - 209219.31732346443, - 209341.80933132127, - 209606.08393758812, - 210025.1902127797, - 210178.96918174214, - 209153.4624049807, - 209568.11168912178, - 209626.68832728674, - 209473.0146277124, - 209765.0623971166, - 209999.9276541881, - 209482.44329175388, - 210003.31920550333, - 210000.1373512753, - 209497.7465955148, - 209703.77016311247, - 209755.99996242253, - 209606.89585622677, - 210030.678461667, - 209536.91600574946, - 210237.75525672067, - 209656.60664025295, - 209398.7478564765, - 210067.86746823895, - 209897.09427103377, - 210020.36248073546, - 210038.39313800723, - 209892.1894473106, - 209835.25597143418, - 210273.61348731394, - 210073.15594932824, - 209711.90705277745, - 209807.72539692037, - 209337.38752386876, - 210937.2176169452, - 210450.6147262442, - 211544.2948944352, - 209925.14929617, - 211158.49568151485, - 209891.18190932588, - 208870.59677230412, - 210052.8916537282, - 211629.91517208362, - 209575.68450640282, - 210002.18977769677, - 209195.01311380262, - 209815.55541911034, - 209900.41630612695, - 210976.63408144715, - 209649.94604224118, - 209942.01723497245, - 210205.65076515498, - 209271.0392897198, - 213351.9861041029, - 210247.35906245033, - 210594.9361077169, - 209185.94721334736, - 210182.80065665772, - 215659.8063286464, - 210027.7130234052, - 209319.32330954509, - 208101.2237929332, - 208162.21272714835, - 210165.77441030444, - 211072.04163240467, - 210104.59702903414, - 208629.04005961417, - 209752.83297614046, - 210475.15283129475, - 210147.06550911537, - 210842.33404011838, - 211675.58449661444, - 210649.19355354935, - 210327.09928161887, - 210983.2888500684, - 208934.37832576697, - 208862.4418872454, - 208841.85878989424, - 209569.8488536328, - 210477.27663141268, - 209277.79484958266, - 210199.23538059017, - 208485.99249868075, - 209759.8796501344, - 209665.9088091727, - 209348.329534732, - 209350.36644353435, - 210057.187634407, - 209319.89687701926, - 208873.4546676195, - 209633.40834710267, - 209449.82362765417, - 210508.3918094066, - 210288.6596224489, - 209427.52951589925, - 209705.93684276557, - 210151.64733212045, - 210594.39887048368, - 208842.8179202417, - 209631.35310541585, - 210008.42426473138, - 210355.1532891372, - 209693.59675222257, - 212300.26944956745, - 210630.58431600456, - 210326.22473285598, - 209506.0562796084, - 209596.99541708373, - 208673.50809774705, - 209123.50637360165, - 209513.1928787636, - 208960.30563021582, - 208742.55218027497, - 209562.5650152579, - 208887.98695601156, - 210541.3111922813 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/excluded_tile/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_empty_tile_filter/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_empty_tile_filter/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_empty_tile_filter/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_empty_tile_filter/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_all_mz/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_all_mz/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_all_mz/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_all_mz/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_mz/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_mz/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_mz/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_all_mz_and_tile_filter_with_mz/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_empty_tile_filter/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_empty_tile_filter/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_empty_tile_filter/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_empty_tile_filter/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_all_mz/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_all_mz/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_all_mz/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_all_mz/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_mz/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_mz/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_mz/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/dashboard_filter_with_mz_and_tile_filter_with_mz/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_empty_tile_filter/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_empty_tile_filter/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_empty_tile_filter/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_empty_tile_filter/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_all_mz/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_all_mz/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_all_mz/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_all_mz/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_mz/metrics_get_by_id0.json b/internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_mz/metrics_get_by_id_base.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_mz/metrics_get_by_id0.json rename to internal/sli/testdata/dashboards/custom_charting/management_zones_work/no_dashboard_filter_and_tile_filter_with_mz/metrics_get_by_id_base.json diff --git a/internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/no_splitby_no_filterby/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_cpu_usage_avg/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_disk_queuelength_max/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/host_mem_usage_avg/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/non_db_child_call_count/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/process_cpu_avg/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/process_memory_avg/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p50/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/response_time_p90/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/throughput/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/old_tests/worker_process_count_avg/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_autotag/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_service_filterby_specificentity/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_id.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_id.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query1.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query_first.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query1.json diff --git a/internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query2.json similarity index 100% rename from internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query_second.json rename to internal/sli/testdata/dashboards/custom_charting/splitby_servicekeyrequest_filterby_autotag/metrics_get_by_query2.json diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id.json similarity index 94% rename from internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id.json index e795ab0f2..37b0c877a 100644 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id_full.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1666261597089, + "lastWritten": 1674739663687, "entityType": [ "SERVICE" ], @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id_base.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id_base.json index 76965298d..77d2798a8 100644 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id_base.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id_base.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1666265323048, + "lastWritten": 1674739638950, "entityType": [ "SERVICE" ], @@ -49,6 +49,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true } diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query1.json similarity index 82% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_query1.json rename to internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query1.json index d4e71bd66..69e81b792 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query1.json @@ -2,11 +2,14 @@ "totalCount": 1, "nextPageKey": null, "resolution": "1h", + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." + ], "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.005844, - "dimensionCountRatio": 0.0487, + "metricId": "(builtin:service.response.time:splitBy():avg:names):toUnit(MicroSecond,Byte)", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -40,7 +43,7 @@ "values": [ 54934.93891767586, 54818.50756764941, - 54821.86675170188, + 54821.84842054894, 54919.61362203189, 54826.16586296582, 54934.41099954065, @@ -58,12 +61,15 @@ 54834.40420610275, 54558.368537797556, 54808.61520734298, - 54989.47957807731, - 54904.36234832176, + 54989.47337630238, + 54904.357616097506, 54824.22258908881, 54742.91667039969 ] } + ], + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query2.json similarity index 54% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_query2.json rename to internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query2.json index 5e5e24d20..2550367ea 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query2.json @@ -2,11 +2,14 @@ "totalCount": 1, "nextPageKey": null, "resolution": "Inf", + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." + ], "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "(builtin:service.response.time:splitBy():avg:names):toUnit(MicroSecond,Byte)", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,9 +18,12 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 54896.485186544574 ] } + ], + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." ] } ] diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query_first.json deleted file mode 100644 index 14a17ba75..000000000 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query_first.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "10m", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy():avg:names", - "dataPointCountRatio": 0.0699408, - "dimensionCountRatio": 0.04857, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, - 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, - 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, - 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, - 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, - 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, - 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, - 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, - 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, - 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, - 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, - 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, - 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, - 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, - 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, - 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, - 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, - 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, - 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, - 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, - 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, - 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, - 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, - 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, - 1664409600000 - ], - "values": [ - 54820.03373164987, - 55218.99471220384, - 55071.49928878831, - 54949.78353754613, - 54792.09863487236, - 54758.23014110582, - 54839.84122407719, - 55080.79677446355, - 54553.826345367015, - 54700.14292835205, - 54737.2003722548, - 55002.27033954363, - 54777.74025995784, - 54920.93069442279, - 54564.00216313528, - 55127.85502136979, - 54649.187273431846, - 54903.09771335987, - 54811.92754307572, - 54954.78607277203, - 55320.74452442934, - 54811.32374927372, - 54789.12016856007, - 54832.67417526022, - 54882.66109509589, - 54839.12680134036, - 54963.65066827593, - 54833.89919248517, - 54726.41233535216, - 54711.6734476709, - 55050.82096058733, - 54804.508598504384, - 55043.67518606438, - 54909.71511835754, - 54832.34011665316, - 54965.59893223934, - 54768.34111642939, - 54769.87290857302, - 54838.65544370555, - 54639.0661843702, - 54871.37265354548, - 54877.451343791385, - 54884.69594899173, - 54830.335242511755, - 54909.95975180857, - 54729.30936347974, - 54857.07455554992, - 54773.180566804505, - 57040.51818064292, - 54815.08510582958, - 54638.81806222, - 54931.655559810424, - 54822.79794409753, - 54943.88083062903, - 59189.65722406022, - 54863.39737403222, - 54865.96204806309, - 54941.49568657858, - 55013.6698386867, - 54927.511166520126, - 55034.0434218988, - 54726.585503515416, - 55179.36971275004, - 55140.22470784515, - 54873.353515106246, - 55046.39285477691, - 55219.21159741783, - 53953.047819327396, - 54398.93323329027, - 54638.48781541484, - 55437.86906753935, - 54777.13448401533, - 54614.82884669915, - 54741.899303641876, - 54811.067369581295, - 54589.01308088208, - 55234.24117269804, - 54332.28349304332, - 54490.19518987563, - 54634.571387632306, - 54716.22231328921, - 56106.07520870239, - 54878.24152910459, - 55026.275312892016, - 54081.654492523165, - 55144.45957110088, - 56071.58167898117, - 54385.870900343165, - 54458.36845208812, - 54230.56669550621, - 54258.731741534466, - 55081.29456308478, - 55865.60168431374, - 55196.5338318562, - 53852.42383215121, - 55496.39855469356, - 55323.17160213487, - 54835.549739796435, - 55074.18764280705, - 54714.90320689123, - 55315.876354608066, - 54894.23055589334, - 54762.26818212387, - 54519.16418366507, - 55263.627200541814, - 54644.019993779904, - 54705.427177621474, - 55111.50943922037, - 54662.1410122232, - 54391.73053502808, - 53794.626921183415, - 54720.05095351137, - 54882.17257639208, - 54895.636923092046, - 54843.223935575785, - 55041.561428220484, - 54674.520597537055, - 54655.125680576966, - 54893.71445497061, - 54744.62396520675, - 54977.05859708377, - 55160.030160401315, - 54764.61432756854, - 54725.26721258407, - 55183.882339578675, - 55129.065580386196, - 54626.46311949491, - 54849.14344749185, - 54963.18046961137, - 54816.06156961105, - 54733.57320804991, - 55447.00928208658, - 55124.80110455526, - 55027.30869873211, - 54987.10183916898, - 55062.99573491732, - 53716.04621333344, - 55011.03937116556, - 54764.56758589279, - 54588.83623561774, - 54533.389405348695, - 54877.71688140235, - 54616.27774406533, - 55079.69618901161 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query_second.json deleted file mode 100644 index 4268f0c6f..000000000 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_query_second.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy():avg:names", - "dataPointCountRatio": 2.4285E-4, - "dimensionCountRatio": 0.04857, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48858596068 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_units_convert_error.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_units_convert_error.json deleted file mode 100644 index 72cecf571..000000000 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_units_convert_error.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": 400, - "message": "Cannot convert MicroSecond to Byte." - } -} diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id_full.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id.json similarity index 94% rename from internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id_full.json rename to internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id.json index 8006c11fe..24aa9a356 100644 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_error/metrics_get_by_id_full.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1666265323048, + "lastWritten": 1674656203514, "entityType": [ "SERVICE" ], @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id_base.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id_base.json index d72ca250a..02d7f35ed 100644 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id_base.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_id_base.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1666261537089, + "lastWritten": 1674656203514, "entityType": [ "SERVICE" ], @@ -49,6 +49,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true } diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query1.json similarity index 53% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_query1.json rename to internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query1.json index d4e71bd66..90d348eba 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.005844, - "dimensionCountRatio": 0.0487, + "metricId": "(builtin:service.response.time:splitBy():avg:names):toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.86675170188, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47957807731, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 + 54.934938917675865, + 54.81850756764941, + 54.82184842054894, + 54.91961362203189, + 54.82616586296582, + 54.934410999540646, + 54.79409757739493, + 54.83075287658759, + 55.198896436065304, + 55.63289885091464, + 55.000065945797246, + 54.73859962308229, + 54.72029420559084, + 54.97313689063351, + 54.72404691394192, + 54.956600808105726, + 55.02626777832012, + 54.834404206102754, + 54.558368537797556, + 54.808615207342974, + 54.989473376302385, + 54.904357616097506, + 54.82422258908881, + 54.74291667039969 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query2.json similarity index 70% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_query2.json rename to internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query2.json index f4a6fff0e..0374a5f3d 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.435E-4, - "dimensionCountRatio": 0.0487, + "metricId": "(builtin:service.response.time:splitBy():avg:names):toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.48640187603 + 54.896485186544574 ] } ] diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query_first.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query_first.json deleted file mode 100644 index 14a17ba75..000000000 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query_first.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "10m", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy():avg:names", - "dataPointCountRatio": 0.0699408, - "dimensionCountRatio": 0.04857, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, - 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, - 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, - 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, - 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, - 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, - 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, - 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, - 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, - 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, - 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, - 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, - 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, - 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, - 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, - 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, - 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, - 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, - 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, - 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, - 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, - 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, - 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, - 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, - 1664409600000 - ], - "values": [ - 54820.03373164987, - 55218.99471220384, - 55071.49928878831, - 54949.78353754613, - 54792.09863487236, - 54758.23014110582, - 54839.84122407719, - 55080.79677446355, - 54553.826345367015, - 54700.14292835205, - 54737.2003722548, - 55002.27033954363, - 54777.74025995784, - 54920.93069442279, - 54564.00216313528, - 55127.85502136979, - 54649.187273431846, - 54903.09771335987, - 54811.92754307572, - 54954.78607277203, - 55320.74452442934, - 54811.32374927372, - 54789.12016856007, - 54832.67417526022, - 54882.66109509589, - 54839.12680134036, - 54963.65066827593, - 54833.89919248517, - 54726.41233535216, - 54711.6734476709, - 55050.82096058733, - 54804.508598504384, - 55043.67518606438, - 54909.71511835754, - 54832.34011665316, - 54965.59893223934, - 54768.34111642939, - 54769.87290857302, - 54838.65544370555, - 54639.0661843702, - 54871.37265354548, - 54877.451343791385, - 54884.69594899173, - 54830.335242511755, - 54909.95975180857, - 54729.30936347974, - 54857.07455554992, - 54773.180566804505, - 57040.51818064292, - 54815.08510582958, - 54638.81806222, - 54931.655559810424, - 54822.79794409753, - 54943.88083062903, - 59189.65722406022, - 54863.39737403222, - 54865.96204806309, - 54941.49568657858, - 55013.6698386867, - 54927.511166520126, - 55034.0434218988, - 54726.585503515416, - 55179.36971275004, - 55140.22470784515, - 54873.353515106246, - 55046.39285477691, - 55219.21159741783, - 53953.047819327396, - 54398.93323329027, - 54638.48781541484, - 55437.86906753935, - 54777.13448401533, - 54614.82884669915, - 54741.899303641876, - 54811.067369581295, - 54589.01308088208, - 55234.24117269804, - 54332.28349304332, - 54490.19518987563, - 54634.571387632306, - 54716.22231328921, - 56106.07520870239, - 54878.24152910459, - 55026.275312892016, - 54081.654492523165, - 55144.45957110088, - 56071.58167898117, - 54385.870900343165, - 54458.36845208812, - 54230.56669550621, - 54258.731741534466, - 55081.29456308478, - 55865.60168431374, - 55196.5338318562, - 53852.42383215121, - 55496.39855469356, - 55323.17160213487, - 54835.549739796435, - 55074.18764280705, - 54714.90320689123, - 55315.876354608066, - 54894.23055589334, - 54762.26818212387, - 54519.16418366507, - 55263.627200541814, - 54644.019993779904, - 54705.427177621474, - 55111.50943922037, - 54662.1410122232, - 54391.73053502808, - 53794.626921183415, - 54720.05095351137, - 54882.17257639208, - 54895.636923092046, - 54843.223935575785, - 55041.561428220484, - 54674.520597537055, - 54655.125680576966, - 54893.71445497061, - 54744.62396520675, - 54977.05859708377, - 55160.030160401315, - 54764.61432756854, - 54725.26721258407, - 55183.882339578675, - 55129.065580386196, - 54626.46311949491, - 54849.14344749185, - 54963.18046961137, - 54816.06156961105, - 54733.57320804991, - 55447.00928208658, - 55124.80110455526, - 55027.30869873211, - 54987.10183916898, - 55062.99573491732, - 53716.04621333344, - 55011.03937116556, - 54764.56758589279, - 54588.83623561774, - 54533.389405348695, - 54877.71688140235, - 54616.27774406533, - 55079.69618901161 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query_second.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query_second.json deleted file mode 100644 index 4268f0c6f..000000000 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_get_by_query_second.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy():avg:names", - "dataPointCountRatio": 2.4285E-4, - "dimensionCountRatio": 0.04857, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48858596068 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_units_convert1.json b/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_units_convert1.json deleted file mode 100644 index eb19c9b79..000000000 --- a/internal/sli/testdata/dashboards/custom_charting/unit_transform_milliseconds/metrics_units_convert1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "unitId": "MilliSecond", - "resultValue": 54.89648858596068 -} diff --git a/internal/sli/testdata/dashboards/data_explorer/no_entity_type/dashboard.json b/internal/sli/testdata/dashboards/data_explorer/no_entity_type/dashboard.json index 26e2b2a7e..324403128 100644 --- a/internal/sli/testdata/dashboards/data_explorer/no_entity_type/dashboard.json +++ b/internal/sli/testdata/dashboards/data_explorer/no_entity_type/dashboard.json @@ -27,37 +27,92 @@ "queries": [ { "id": "A", - "metric": "builtin:security.securityProblem.open.managementZone", - "spaceAggregation": "SUM", "timeAggregation": "DEFAULT", "splitBy": [ "Risk Level" ], - "sortBy": "DESC", - "filterBy": { - "filterOperator": "AND", - "nestedFilters": [ + "metricSelector": "builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:sort(value(sum,descending)):fold(avg)", + "enabled": true + } + ], + "visualConfig": { + "type": "SINGLE_VALUE", + "global": { + "hideLegend": false + }, + "rules": [ + { + "matcher": "A:", + "properties": { + "color": "DEFAULT" + }, + "seriesOverrides": [] + } + ], + "axes": { + "xAxis": { + "displayName": "", + "visible": true + }, + "yAxes": [ + { + "displayName": "", + "visible": true, + "min": "AUTO", + "max": "AUTO", + "position": "LEFT", + "queryIds": [ + "A" + ], + "defaultAxis": true + } + ] + }, + "heatmapSettings": { + "yAxis": "VALUE", + "showLabels": false + }, + "singleValueSettings": { + "showTrend": true, + "showSparkLine": true, + "linkTileColorToThreshold": true + }, + "thresholds": [ + { + "axisTarget": "LEFT", + "rules": [ + { + "color": "#7dc540" + }, + { + "color": "#f5d30f" + }, { - "filter": "Risk Level", - "filterType": "DIMENSION", - "filterOperator": "OR", - "nestedFilters": [], - "criteria": [ - { - "value": "HIGH", - "evaluator": "EQ" - } - ] + "color": "#dc172a" } ], - "criteria": [] - }, - "limit": 100, - "enabled": true + "queryId": "", + "visible": true + } + ], + "tableSettings": { + "isThresholdBackgroundAppliedToCell": false + }, + "graphChartSettings": { + "connectNulls": false + }, + "honeycombSettings": { + "showHive": true, + "showLegend": true, + "showLabels": false } - ], + }, + "queriesSettings": { + "resolution": "" + }, "metricExpressions": [ - "resolution=null&(builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:auto:sort(value(sum,descending)):limit(100)):limit(100):names" + "resolution=null&(builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:sort(value(sum,descending)):fold(avg)):limit(100):names:fold(auto)", + "resolution=null&(builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:sort(value(sum,descending)):fold(avg))" ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/no_entity_type/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/no_entity_type/metrics_get_by_query1.json index 13bb43c38..382a59e8c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/no_entity_type/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/no_entity_type/metrics_get_by_query1.json @@ -1,13 +1,28 @@ { - "totalCount": 0, - "nextPageKey": null, - "resolution": "10m", - "result": [ + "totalCount": 1, + "nextPageKey": null, + "resolution": "1h", + "result": [ + { + "metricId": "(builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:sort(value(sum,descending)):fold(avg)):limit(100):names:fold(auto)", + "dataPointCountRatio": 0.0000144, + "dimensionCountRatio": 0.00012, + "data": [ { - "metricId": "(builtin:security.securityProblem.open.managementZone:filter(and(or(eq(\"Risk Level\",HIGH)))):splitBy(\"Risk Level\"):sum:auto:sort(value(sum,descending)):limit(100)):limit(100):names", - "dataPointCountRatio": 0.0, - "dimensionCountRatio": 0.0, - "data": [] + "dimensions": [ + "HIGH" + ], + "dimensionMap": { + "Risk Level": "HIGH" + }, + "timestamps": [ + 1664409600000 + ], + "values": [ + 536.4052024482108 + ] } - ] + ] + } + ] } diff --git a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query1.json index a441fe6b0..b669da859 100644 --- a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query1.json @@ -1,307 +1,67 @@ { "totalCount": 1, "nextPageKey": null, - "resolution": "10m", + "resolution": "1h", "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0699408, - "dimensionCountRatio": 0.04857, + "metricId": "((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], "dimensionMap": {}, "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, 1664409600000 ], "values": [ - 54820.03373164987, - 55218.99471220384, - 55071.49928878831, - 54949.78353754613, - 54792.09863487236, - 54758.23014110582, - 54839.84122407719, - 55080.79677446355, - 54553.826345367015, - 54700.14292835205, - 54737.2003722548, - 55002.27033954363, - 54777.74025995784, - 54920.93069442279, - 54564.00216313528, - 55127.85502136979, - 54649.187273431846, - 54903.09771335987, - 54811.92754307572, - 54954.78607277203, - 55320.74452442934, - 54811.32374927372, - 54789.12016856007, - 54832.67417526022, - 54882.66109509589, - 54839.12680134036, - 54963.65066827593, - 54833.89919248517, - 54726.41233535216, - 54711.6734476709, - 55050.82096058733, - 54804.508598504384, - 55043.67518606438, - 54909.71511835754, - 54832.34011665316, - 54965.59893223934, - 54768.34111642939, - 54769.87290857302, - 54838.65544370555, - 54639.0661843702, - 54871.37265354548, - 54877.451343791385, - 54884.69594899173, - 54830.335242511755, - 54909.95975180857, - 54729.30936347974, - 54857.07455554992, - 54773.180566804505, - 57040.51818064292, - 54815.08510582958, - 54638.81806222, - 54931.655559810424, - 54822.79794409753, - 54943.88083062903, - 59189.65722406022, - 54863.39737403222, - 54865.96204806309, - 54941.49568657858, - 55013.6698386867, - 54927.511166520126, - 55034.0434218988, - 54726.585503515416, - 55179.36971275004, - 55140.22470784515, - 54873.353515106246, - 55046.39285477691, - 55219.21159741783, - 53953.047819327396, - 54398.93323329027, - 54638.48781541484, - 55437.86906753935, - 54777.13448401533, - 54614.82884669915, - 54741.899303641876, - 54811.067369581295, - 54589.01308088208, - 55234.24117269804, - 54332.28349304332, - 54490.19518987563, - 54634.571387632306, - 54716.22231328921, - 56106.07520870239, - 54878.24152910459, - 55026.275312892016, - 54081.654492523165, - 55144.45957110088, - 56071.58167898117, - 54385.870900343165, - 54458.36845208812, - 54230.56669550621, - 54258.731741534466, - 55081.29456308478, - 55865.60168431374, - 55196.5338318562, - 53852.42383215121, - 55496.39855469356, - 55323.17160213487, - 54835.549739796435, - 55074.18764280705, - 54714.90320689123, - 55315.876354608066, - 54894.23055589334, - 54762.26818212387, - 54519.16418366507, - 55263.627200541814, - 54644.019993779904, - 54705.427177621474, - 55111.50943922037, - 54662.1410122232, - 54391.73053502808, - 53794.626921183415, - 54720.05095351137, - 54882.17257639208, - 54895.636923092046, - 54843.223935575785, - 55041.561428220484, - 54674.520597537055, - 54655.125680576966, - 54893.71445497061, - 54744.62396520675, - 54977.05859708377, - 55160.030160401315, - 54764.61432756854, - 54725.26721258407, - 55183.882339578675, - 55129.065580386196, - 54626.46311949491, - 54849.14344749185, - 54963.18046961137, - 54816.06156961105, - 54733.57320804991, - 55447.00928208658, - 55124.80110455526, - 55027.30869873211, - 54987.10183916898, - 55062.99573491732, - 53716.04621333344, - 55011.03937116556, - 54764.56758589279, - 54588.83623561774, - 54533.389405348695, - 54877.71688140235, - 54616.27774406533, - 55079.69618901161 + 54.934938917675865, + 54.81850756764941, + 54.82184842054894, + 54.91961362203189, + 54.82616586296582, + 54.934410999540646, + 54.79409757739493, + 54.83075287658759, + 55.198896436065304, + 55.63289885091464, + 55.000065945797246, + 54.73859962308229, + 54.72029420559084, + 54.97313689063351, + 54.72404691394192, + 54.956600808105726, + 55.02626777832012, + 54.834404206102754, + 54.558368537797556, + 54.808615207342974, + 54.989473376302385, + 54.904357616097506, + 54.82422258908881, + 54.74291667039969 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query2.json index ff5a9bdce..a19b81a88 100644 --- a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.4285E-4, - "dimensionCountRatio": 0.04857, + "metricId": "((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.48858596068 + 54.896485186544574 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_units_convert1.json deleted file mode 100644 index eb19c9b79..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/pick_correct_visual_config_rule/metrics_units_convert1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "unitId": "MilliSecond", - "resultValue": 54.89648858596068 -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/dashboard.template.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/dashboard.template.json index a2e316c0d..515b02f64 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/dashboard.template.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/dashboard.template.json @@ -101,7 +101,7 @@ } }, "metricExpressions": [ - "resolution=null&{{.MetricSelector}}" + "resolution={{.Resolution}}&{{.MetricSelector}}" ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_query2.json deleted file mode 100644 index 08bb85b03..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 341746808 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query1.json index 9821cafb4..bbcec8284 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query1.json @@ -2,11 +2,14 @@ "totalCount": 1, "nextPageKey": null, "resolution": "1h", + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." + ], "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,Byte)", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -59,11 +62,14 @@ 54558.368537797556, 54808.61520734298, 54989.47337630238, - 54904.36234832176, + 54904.357616097506, 54824.22258908881, 54742.91667039969 ] } + ], + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query2.json index 5e5e24d20..7790ec4d1 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_get_by_query2.json @@ -2,11 +2,14 @@ "totalCount": 1, "nextPageKey": null, "resolution": "Inf", + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." + ], "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,Byte)", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,9 +18,12 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 54896.485186544574 ] } + ], + "warnings": [ + "SourceUnit 'MicroSecond' cannot be converted to targetUnit 'Byte'." ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_units_convert1.json deleted file mode 100644 index a1e28b782..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_byte/metrics_units_convert1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": 400, - "message": "Cannot convert MicroSecond to Byte." - } -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_query1.json index 9821cafb4..1d6d1dc5b 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_query1.json @@ -1,70 +1,6 @@ { - "totalCount": 1, - "nextPageKey": null, - "resolution": "1h", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664326800000, - 1664330400000, - 1664334000000, - 1664337600000, - 1664341200000, - 1664344800000, - 1664348400000, - 1664352000000, - 1664355600000, - 1664359200000, - 1664362800000, - 1664366400000, - 1664370000000, - 1664373600000, - 1664377200000, - 1664380800000, - 1664384400000, - 1664388000000, - 1664391600000, - 1664395200000, - 1664398800000, - 1664402400000, - 1664406000000, - 1664409600000 - ], - "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.84842054894, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47337630238, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 - ] - } - ] - } - ] + "error": { + "code": 400, + "message": "No unit found using the Unit Id: 'Special'." + } } diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_query2.json deleted file mode 100644 index 5e5e24d20..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.485383423984 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_units_convert1.json deleted file mode 100644 index 9e04d31bc..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_special/metrics_units_convert1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": 400, - "message": "No unit found using the Unit Id \"Special\"." - } -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_query1.json index 9821cafb4..8ccb152b6 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_get_by_query1.json @@ -1,70 +1,6 @@ { - "totalCount": 1, - "nextPageKey": null, - "resolution": "1h", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664326800000, - 1664330400000, - 1664334000000, - 1664337600000, - 1664341200000, - 1664344800000, - 1664348400000, - 1664352000000, - 1664355600000, - 1664359200000, - 1664362800000, - 1664366400000, - 1664370000000, - 1664373600000, - 1664377200000, - 1664380800000, - 1664384400000, - 1664388000000, - 1664391600000, - 1664395200000, - 1664398800000, - 1664402400000, - 1664406000000, - 1664409600000 - ], - "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.84842054894, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47337630238, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 - ] - } - ] - } - ] + "error": { + "code": 400, + "message": "No unit found using the Unit Id: 'Kilo'." + } } diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_units_convert1.json deleted file mode 100644 index 51607d856..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_srt_thousand/metrics_units_convert1.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": 400, - "message": "No unit found using the Unit Id \"Kilo\"." - } -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_byte/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_byte/metrics_get_by_query2.json deleted file mode 100644 index 4bdc3c6b2..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_byte/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 1 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_millisecond/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_millisecond/metrics_get_by_query1.json deleted file mode 100644 index 90f2f8f46..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_millisecond/metrics_get_by_query1.json +++ /dev/null @@ -1 +0,0 @@ -{"totalCount":1,"nextPageKey":null,"resolution":"1h","result":[{"metricId":"builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()","dataPointCountRatio":0.0116928,"dimensionCountRatio":0.09744,"data":[{"dimensions":[],"dimensionMap":{},"timestamps":[1664326800000,1664330400000,1664334000000,1664337600000,1664341200000,1664344800000,1664348400000,1664352000000,1664355600000,1664359200000,1664362800000,1664366400000,1664370000000,1664373600000,1664377200000,1664380800000,1664384400000,1664388000000,1664391600000,1664395200000,1664398800000,1664402400000,1664406000000,1664409600000],"values":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}]}]} \ No newline at end of file diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_millisecond/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_millisecond/metrics_get_by_query2.json deleted file mode 100644 index 4bdc3c6b2..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_millisecond/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 1 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_special/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_special/metrics_get_by_query2.json deleted file mode 100644 index 4bdc3c6b2..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_uum_special/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 1 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query1.json index 4d043a386..84aab4128 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query2.json index 08bb85b03..c86206779 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_auto/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query1.json index 4d043a386..b116c07c7 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000000000", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 14233754, - 14258882, - 14199668, - 14254956, - 14250858, - 14258586, - 14244492, - 14249772, - 14273600, - 14248220, - 14149350, - 14232167, - 14233523, - 14302359, - 14366900, - 14160977, - 14191227, - 14156832, - 14250061, - 14258826, - 14361479, - 14113492, - 14286028, - 14210799 + 0.014233754, + 0.014258882, + 0.014199668, + 0.014254956, + 0.014250858, + 0.014258586, + 0.014244492, + 0.014249772, + 0.0142736, + 0.01424822, + 0.01414935, + 0.014232167, + 0.014233523, + 0.014302359, + 0.0143669, + 0.014160977, + 0.014191227, + 0.014156832, + 0.014250061, + 0.014258826, + 0.014361479, + 0.014113492, + 0.014286028, + 0.014210799 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query2.json index 08bb85b03..b2bc69122 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_billion/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000000000", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 341746808 + 0.341746808 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query1.json index 4d043a386..84aab4128 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query2.json index 08bb85b03..c86206779 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_empty/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query1.json index 4d043a386..c2fb0c27c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000000", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 14233754, - 14258882, - 14199668, - 14254956, - 14250858, - 14258586, - 14244492, - 14249772, - 14273600, - 14248220, - 14149350, - 14232167, - 14233523, - 14302359, - 14366900, - 14160977, - 14191227, - 14156832, - 14250061, - 14258826, - 14361479, - 14113492, - 14286028, - 14210799 + 14.233754, + 14.258882, + 14.199668, + 14.254956, + 14.250858, + 14.258586, + 14.244492, + 14.249772, + 14.2736, + 14.24822, + 14.14935, + 14.232167, + 14.233523, + 14.302359, + 14.3669, + 14.160977, + 14.191227, + 14.156832, + 14.250061, + 14.258826, + 14.361479, + 14.113492, + 14.286028, + 14.210799 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query2.json index 08bb85b03..8e958575b 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_million/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000000", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 341746808 + 341.746808 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query1.json index 4d043a386..84aab4128 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query2.json index 08bb85b03..c86206779 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_none/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query1.json index 4d043a386..ac6615984 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 14233754, - 14258882, - 14199668, - 14254956, - 14250858, - 14258586, - 14244492, - 14249772, - 14273600, - 14248220, - 14149350, - 14232167, - 14233523, - 14302359, - 14366900, - 14160977, - 14191227, - 14156832, - 14250061, - 14258826, - 14361479, - 14113492, - 14286028, - 14210799 + 14233.754, + 14258.882, + 14199.668, + 14254.956, + 14250.858, + 14258.586, + 14244.492, + 14249.772, + 14273.6, + 14248.22, + 14149.35, + 14232.167, + 14233.523, + 14302.359, + 14366.9, + 14160.977, + 14191.227, + 14156.832, + 14250.061, + 14258.826, + 14361.479, + 14113.492, + 14286.028, + 14210.799 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query2.json index 08bb85b03..684100877 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_thousand/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 341746808 + 341746.808 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_id.json index 231906b6c..7b79a8efa 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_id.json @@ -45,6 +45,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query1.json index 4d043a386..7a9328a1f 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000000000000", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 14233754, - 14258882, - 14199668, - 14254956, - 14250858, - 14258586, - 14244492, - 14249772, - 14273600, - 14248220, - 14149350, - 14232167, - 14233523, - 14302359, - 14366900, - 14160977, - 14191227, - 14156832, - 14250061, - 14258826, - 14361479, - 14113492, - 14286028, - 14210799 + 1.4233754E-5, + 1.4258882E-5, + 1.4199668E-5, + 1.4254956E-5, + 1.4250858E-5, + 1.4258586E-5, + 1.4244492E-5, + 1.4249772E-5, + 1.42736E-5, + 1.424822E-5, + 1.414935E-5, + 1.4232167E-5, + 1.4233523E-5, + 1.4302359E-5, + 1.43669E-5, + 1.4160977E-5, + 1.4191227E-5, + 1.4156832E-5, + 1.4250061E-5, + 1.4258826E-5, + 1.4361479E-5, + 1.4113492E-5, + 1.4286028E-5, + 1.4210799E-5 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query2.json index 08bb85b03..5705f911c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_ndbccc_trillion/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000000000000", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 341746808 + 3.41746808E-4 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_id.json new file mode 100644 index 000000000..e84a19bc6 --- /dev/null +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_id.json @@ -0,0 +1,51 @@ +{ + "metricId": "(builtin:security.securityProblem.open.global:splitBy(Type):sort(value(auto,descending)):limit(20)):limit(100):names", + "displayName": "Open Security Problems (global)", + "description": "", + "unit": "Count", + "dduBillable": false, + "created": 0, + "lastWritten": null, + "entityType": [], + "aggregationTypes": [ + "auto", + "avg", + "max", + "min" + ], + "transformations": [ + "filter", + "fold", + "limit", + "merge", + "names", + "parents", + "timeshift", + "sort", + "last", + "splitBy", + "lastReal", + "setUnit" + ], + "defaultAggregation": { + "type": "avg" + }, + "dimensionDefinitions": [ + { + "key": "Type", + "name": null, + "displayName": "Type", + "index": null, + "type": "STRING" + } + ], + "tags": [], + "metricValueType": { + "type": "unknown" + }, + "scalar": false, + "resolutionInfSupported": false, + "warnings": [ + "The field dimensionCardinalities is only supported for untransformed single metric keys and was ignored." + ] +} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_query1.json new file mode 100644 index 000000000..85c46ecfa --- /dev/null +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_query1.json @@ -0,0 +1,134 @@ +{ + "totalCount": 2, + "nextPageKey": null, + "resolution": "1h", + "result": [ + { + "metricId": "((builtin:security.securityProblem.open.global:splitBy(Type):sort(value(auto,descending)):limit(20)):limit(100):names)/1000", + "dataPointCountRatio": 6.0E-6, + "dimensionCountRatio": 5.0E-5, + "data": [ + { + "dimensions": [ + "Third-party vulnerability" + ], + "dimensionMap": { + "Type": "Third-party vulnerability" + }, + "timestamps": [ + 1664326800000, + 1664330400000, + 1664334000000, + 1664337600000, + 1664341200000, + 1664344800000, + 1664348400000, + 1664352000000, + 1664355600000, + 1664359200000, + 1664362800000, + 1664366400000, + 1664370000000, + 1664373600000, + 1664377200000, + 1664380800000, + 1664384400000, + 1664388000000, + 1664391600000, + 1664395200000, + 1664398800000, + 1664402400000, + 1664406000000, + 1664409600000 + ], + "values": [ + 0.08361666666666666, + 0.08374166666666666, + 0.08398360655737705, + 0.08364166666666667, + 0.08515416666666667, + 0.0888375, + 0.08915416666666667, + 0.08973333333333333, + 0.09452916666666666, + 0.09547916666666667, + 0.09547540983606558, + 0.0965625, + 0.09697083333333333, + 0.0969375, + 0.09745258620689655, + 0.09782916666666666, + 0.09726666666666667, + 0.09561475409836065, + 0.096375, + 0.0966875, + 0.08940000000000001, + 0.08896666666666667, + 0.089225, + 0.08878333333333333 + ] + }, + { + "dimensions": [ + "Code-level vulnerability" + ], + "dimensionMap": { + "Type": "Code-level vulnerability" + }, + "timestamps": [ + 1664326800000, + 1664330400000, + 1664334000000, + 1664337600000, + 1664341200000, + 1664344800000, + 1664348400000, + 1664352000000, + 1664355600000, + 1664359200000, + 1664362800000, + 1664366400000, + 1664370000000, + 1664373600000, + 1664377200000, + 1664380800000, + 1664384400000, + 1664388000000, + 1664391600000, + 1664395200000, + 1664398800000, + 1664402400000, + 1664406000000, + 1664409600000 + ], + "values": [ + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016, + 0.016 + ] + } + ] + } + ] +} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_query2.json new file mode 100644 index 000000000..06408d1d4 --- /dev/null +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_multiple_values/metrics_get_by_query2.json @@ -0,0 +1,42 @@ +{ + "totalCount": 2, + "nextPageKey": null, + "resolution": "Inf", + "result": [ + { + "metricId": "(((builtin:security.securityProblem.open.global:splitBy(Type):sort(value(auto,descending)):limit(20)):limit(100):names):fold)/1000", + "dataPointCountRatio": 6.0E-6, + "dimensionCountRatio": 5.0E-5, + "data": [ + { + "dimensions": [ + "Third-party vulnerability" + ], + "dimensionMap": { + "Type": "Third-party vulnerability" + }, + "timestamps": [ + 1664409600000 + ], + "values": [ + 0.0917177307425399 + ] + }, + { + "dimensions": [ + "Code-level vulnerability" + ], + "dimensionMap": { + "Type": "Code-level vulnerability" + }, + "timestamps": [ + 1664409600000 + ], + "values": [ + 0.016 + ] + } + ] + } + ] +} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_id.json similarity index 58% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_id.json rename to internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_id.json index cd0c350cb..becbdd841 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_id.json @@ -1,37 +1,34 @@ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "displayName": "Response time", + "metricId": "(builtin:security.securityProblem.open.global:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", + "displayName": "Open Security Problems (global)", "description": "", - "unit": "MicroSecond", + "unit": "Count", "dduBillable": false, "created": 0, "lastWritten": null, - "entityType": [ - "SERVICE" - ], + "entityType": [], "aggregationTypes": [ "auto", - "value" + "avg", + "max", + "min" ], "transformations": [ + "filter", "fold", "limit", + "merge", + "names", + "parents", "timeshift", - "rate", "sort", "last", "splitBy", - "default", - "delta", "lastReal", - "smooth", - "rollup", - "partition", - "toUnit", "setUnit" ], "defaultAggregation": { - "type": "value" + "type": "avg" }, "dimensionDefinitions": [], "tags": [], @@ -39,7 +36,7 @@ "type": "unknown" }, "scalar": false, - "resolutionInfSupported": true, + "resolutionInfSupported": false, "warnings": [ "The field dimensionCardinalities is only supported for untransformed single metric keys and was ignored." ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_query1.json similarity index 51% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_query1.json rename to internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_query1.json index 4d043a386..5e6e3f493 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:security.securityProblem.open.global:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names)/1000", + "dataPointCountRatio": 6.0E-6, + "dimensionCountRatio": 5.0E-5, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 14233754, - 14258882, - 14199668, - 14254956, - 14250858, - 14258586, - 14244492, - 14249772, - 14273600, - 14248220, - 14149350, - 14232167, - 14233523, - 14302359, - 14366900, - 14160977, - 14191227, - 14156832, - 14250061, - 14258826, - 14361479, - 14113492, - 14286028, - 14210799 + 0.07009333333333333, + 0.07019333333333333, + 0.07038688524590164, + 0.07011333333333333, + 0.07132333333333334, + 0.07427, + 0.07452333333333333, + 0.07498666666666666, + 0.07882333333333334, + 0.07958333333333333, + 0.07958032786885247, + 0.08045000000000001, + 0.08077666666666668, + 0.08075, + 0.08116206896551724, + 0.08146333333333333, + 0.08101333333333334, + 0.07969180327868852, + 0.0803, + 0.08055, + 0.07472, + 0.07437333333333333, + 0.07458, + 0.07422666666666668 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_query2.json similarity index 59% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_query2.json rename to internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_query2.json index 08bb85b03..da3ab2f79 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_byte/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_osp_thousand_single_value/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "(((builtin:security.securityProblem.open.global:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names):fold)/1000", + "dataPointCountRatio": 6.0E-6, + "dimensionCountRatio": 5.0E-5, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 341746808 + 0.07657418459403192 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query1.json index 9821cafb4..9ab9e7a95 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -59,7 +59,7 @@ 54558.368537797556, 54808.61520734298, 54989.47337630238, - 54904.36234832176, + 54904.357616097506, 54824.22258908881, 54742.91667039969 ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query2.json index 5e5e24d20..f123dbd00 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_auto/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 54896.485186544574 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query1.json index 9821cafb4..e254a9f60 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query1.json @@ -1,70 +1 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "1h", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664326800000, - 1664330400000, - 1664334000000, - 1664337600000, - 1664341200000, - 1664344800000, - 1664348400000, - 1664352000000, - 1664355600000, - 1664359200000, - 1664362800000, - 1664366400000, - 1664370000000, - 1664373600000, - 1664377200000, - 1664380800000, - 1664384400000, - 1664388000000, - 1664391600000, - 1664395200000, - 1664398800000, - 1664402400000, - 1664406000000, - 1664409600000 - ], - "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.84842054894, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47337630238, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 - ] - } - ] - } - ] -} +{"totalCount":1,"nextPageKey":null,"resolution":"1h","result":[{"metricId":"((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,Day)","dataPointCountRatio":0.0058476,"dimensionCountRatio":0.04873,"data":[{"dimensions":[],"dimensionMap":{},"timestamps":[1664326800000,1664330400000,1664334000000,1664337600000,1664341200000,1664344800000,1664348400000,1664352000000,1664355600000,1664359200000,1664362800000,1664366400000,1664370000000,1664373600000,1664377200000,1664380800000,1664384400000,1664388000000,1664391600000,1664395200000,1664398800000,1664402400000,1664406000000,1664409600000],"values":[6.35821052287915E-7,6.344734672181645E-7,6.345121344970942E-7,6.356436761809246E-7,6.345621048954377E-7,6.35814942124313E-7,6.341909441828116E-7,6.346151953308749E-7,6.388761161581632E-7,6.438992922559565E-7,6.365748373356162E-7,6.335486067486376E-7,6.333367384906346E-7,6.362631584564064E-7,6.333801726150684E-7,6.360717686123347E-7,6.368780992861124E-7,6.346574560891522E-7,6.314625988171013E-7,6.343589723072103E-7,6.364522381516479E-7,6.354671020381656E-7,6.345396132996389E-7,6.335985725740704E-7]}]}]} \ No newline at end of file diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query2.json index 5e5e24d20..a8d03ed1d 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,Day)", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 6.353759859553769E-7 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_units_convert1.json deleted file mode 100644 index bb16adb39..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_day/metrics_units_convert1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "unitId": "Day", - "resultValue": 6.353759882340739E-7 -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query1.json index 9821cafb4..9ab9e7a95 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -59,7 +59,7 @@ 54558.368537797556, 54808.61520734298, 54989.47337630238, - 54904.36234832176, + 54904.357616097506, 54824.22258908881, 54742.91667039969 ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query2.json index 5e5e24d20..f123dbd00 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_empty/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 54896.485186544574 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query1.json index 9821cafb4..9ab9e7a95 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -59,7 +59,7 @@ 54558.368537797556, 54808.61520734298, 54989.47337630238, - 54904.36234832176, + 54904.357616097506, 54824.22258908881, 54742.91667039969 ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query2.json index 5e5e24d20..f123dbd00 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_microsecond/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 54896.485186544574 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query1.json index 9821cafb4..b669da859 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.84842054894, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47337630238, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 + 54.934938917675865, + 54.81850756764941, + 54.82184842054894, + 54.91961362203189, + 54.82616586296582, + 54.934410999540646, + 54.79409757739493, + 54.83075287658759, + 55.198896436065304, + 55.63289885091464, + 55.000065945797246, + 54.73859962308229, + 54.72029420559084, + 54.97313689063351, + 54.72404691394192, + 54.956600808105726, + 55.02626777832012, + 54.834404206102754, + 54.558368537797556, + 54.808615207342974, + 54.989473376302385, + 54.904357616097506, + 54.82422258908881, + 54.74291667039969 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query2.json index 5e5e24d20..a19b81a88 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names):toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 54.896485186544574 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_units_convert1.json deleted file mode 100644 index cf107882e..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_millisecond/metrics_units_convert1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "unitId": "MilliSecond", - "resultValue": 54.896485383423986 -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query1.json index 9821cafb4..9ab9e7a95 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -59,7 +59,7 @@ 54558.368537797556, 54808.61520734298, 54989.47337630238, - 54904.36234832176, + 54904.357616097506, 54824.22258908881, 54742.91667039969 ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query2.json index 5e5e24d20..f123dbd00 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_none/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.485383423984 + 54896.485186544574 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_id.json similarity index 72% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_id.json rename to internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_id.json index cd0c350cb..f6344b6f3 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_id.json @@ -1,5 +1,5 @@ { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", + "metricId": "(builtin:service.response.time:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", "displayName": "Response time", "description": "", "unit": "MicroSecond", @@ -11,33 +11,33 @@ ], "aggregationTypes": [ "auto", - "value" + "avg", + "count", + "max", + "median", + "min", + "percentile", + "sum" ], "transformations": [ "fold", "limit", "timeshift", - "rate", "sort", "last", "splitBy", - "default", - "delta", "lastReal", - "smooth", - "rollup", - "partition", - "toUnit", "setUnit" ], "defaultAggregation": { - "type": "value" + "type": "avg" }, "dimensionDefinitions": [], "tags": [], "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_query1.json similarity index 50% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_query1.json rename to internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_query1.json index 4d043a386..93c338fc4 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_special/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 0.0058464, - "dimensionCountRatio": 0.04872, + "metricId": "((builtin:service.response.time:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names):auto:toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 14233754, - 14258882, - 14199668, - 14254956, - 14250858, - 14258586, - 14244492, - 14249772, - 14273600, - 14248220, - 14149350, - 14232167, - 14233523, - 14302359, - 14366900, - 14160977, - 14191227, - 14156832, - 14250061, - 14258826, - 14361479, - 14113492, - 14286028, - 14210799 + 54.934938917675865, + 54.81850756764941, + 54.82184842054894, + 54.91961362203189, + 54.82616586296582, + 54.934410999540646, + 54.79409757739493, + 54.83075287658759, + 55.198896436065304, + 55.63289885091464, + 55.000065945797246, + 54.73859962308229, + 54.72029420559084, + 54.97313689063351, + 54.72404691394192, + 54.956600808105726, + 55.02626777832012, + 54.834404206102754, + 54.558368537797556, + 54.808615207342974, + 54.989473376302385, + 54.904357616097506, + 54.82422258908881, + 54.74291667039969 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_query2.json similarity index 54% rename from internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_query2.json rename to internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_query2.json index 08bb85b03..23f37d48e 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/error_ndbccc_millisecond/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_srt_resolution_10m_millisecond/metrics_get_by_query2.json @@ -1,12 +1,12 @@ { "totalCount": 1, "nextPageKey": null, - "resolution": "Inf", + "resolution": "1h", "result": [ { - "metricId": "(builtin:service.nonDbChildCallCount:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names", - "dataPointCountRatio": 2.436E-4, - "dimensionCountRatio": 0.04872, + "metricId": "(((builtin:service.response.time:splitBy():sort(value(auto,descending)):limit(20)):limit(100):names):fold):auto:toUnit(MicroSecond,MilliSecond)", + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 341746808 + 54.89648587772039 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query1.json index f60c9084d..82f2c082d 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "dataPointCountRatio": 0.0116952, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query2.json index 4bdc3c6b2..7ab48e08f 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_auto/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, + "dataPointCountRatio": 4.873E-4, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query1.json index f60c9084d..014e831ef 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000000000", + "dataPointCountRatio": 0.0116952, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9, + 1.0E-9 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query2.json index 4bdc3c6b2..529e0b7d0 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_billion/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000000000", + "dataPointCountRatio": 4.873E-4, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 1 + 1.0E-9 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query1.json index f60c9084d..82f2c082d 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "dataPointCountRatio": 0.0116952, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query2.json index 4bdc3c6b2..7ab48e08f 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_empty/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, + "dataPointCountRatio": 4.873E-4, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query1.json index f60c9084d..a546a1ee6 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000000", + "dataPointCountRatio": 0.0116952, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6, + 1.0E-6 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query2.json index 4bdc3c6b2..8efdc7973 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_million/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000000", + "dataPointCountRatio": 4.873E-4, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 1 + 1.0E-6 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query1.json index f60c9084d..82f2c082d 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query1.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "dataPointCountRatio": 0.0116952, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query2.json index 4bdc3c6b2..7ab48e08f 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_none/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, + "dataPointCountRatio": 4.873E-4, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query1.json index f60c9084d..656521a7f 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000", + "dataPointCountRatio": 0.0116952, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001, + 0.001 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query2.json index 4bdc3c6b2..d50367e39 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_thousand/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000", + "dataPointCountRatio": 4.873E-4, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 1 + 0.001 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query1.json index f60c9084d..e35a6a79c 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query1.json @@ -4,9 +4,9 @@ "resolution": "1h", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 0.0116928, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000000000000", + "dataPointCountRatio": 0.0116952, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -38,30 +38,30 @@ 1664409600000 ], "values": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1 + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12, + 1.0E-12 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query2.json index 4bdc3c6b2..a9acb30c1 100644 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/data_explorer/unit_transform/success_uum_trillion/metrics_get_by_query2.json @@ -4,9 +4,9 @@ "resolution": "Inf", "result": [ { - "metricId": "builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy()", - "dataPointCountRatio": 4.872E-4, - "dimensionCountRatio": 0.09744, + "metricId": "(builtin:service.response.time:splitBy()/builtin:service.response.time:splitBy())/1000000000000", + "dataPointCountRatio": 4.873E-4, + "dimensionCountRatio": 0.09746, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 1 + 1.0E-12 ] } ] diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/dashboard.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/dashboard.json deleted file mode 100644 index 69affeda9..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/dashboard.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "metadata": { - "configurationVersions": [ - 5 - ], - "clusterVersion": "1.232.0.20211118-204216" - }, - "id": "12345678-1111-4444-8888-123456789012", - "dashboardMetadata": { - "name": "Management Zone Test", - "shared": false, - "owner": "", - "popularity": 1 - }, - "tiles": [ - { - "name": "SRT Bytes", - "tileType": "DATA_EXPLORER", - "configured": true, - "bounds": { - "top": 76, - "left": 114, - "width": 304, - "height": 304 - }, - "tileFilter": {}, - "customName": "Data explorer results", - "queries": [ - { - "id": "A", - "metric": "builtin:service.response.time", - "spaceAggregation": "AVG", - "timeAggregation": "DEFAULT", - "splitBy": [], - "filterBy": { - "nestedFilters": [], - "criteria": [] - }, - "enabled": true - } - ], - "visualConfig": { - "type": "GRAPH_CHART", - "global": { - "hideLegend": false - }, - "rules": [ - { - "matcher": "A:", - "unitTransform": "Byte", - "valueFormat": "auto", - "properties": { - "color": "DEFAULT", - "seriesType": "LINE" - }, - "seriesOverrides": [] - } - ], - "axes": { - "xAxis": { - "displayName": "", - "visible": true - }, - "yAxes": [ - { - "displayName": "", - "visible": true, - "min": "AUTO", - "max": "AUTO", - "position": "LEFT", - "queryIds": [ - "A" - ], - "defaultAxis": true - } - ] - }, - "heatmapSettings": { - "yAxis": "VALUE" - }, - "thresholds": [ - { - "axisTarget": "LEFT", - "rules": [ - { - "color": "#7dc540" - }, - { - "color": "#f5d30f" - }, - { - "color": "#dc172a" - } - ], - "queryId": "", - "visible": true - } - ], - "tableSettings": { - "isThresholdBackgroundAppliedToCell": false - }, - "graphChartSettings": { - "connectNulls": false - }, - "honeycombSettings": { - "showHive": true, - "showLegend": true, - "showLabels": false - } - }, - "metricExpressions": [ - "resolution=null&(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names" - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_query1.json deleted file mode 100644 index a441fe6b0..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_query1.json +++ /dev/null @@ -1,310 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "10m", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0699408, - "dimensionCountRatio": 0.04857, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, - 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, - 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, - 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, - 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, - 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, - 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, - 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, - 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, - 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, - 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, - 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, - 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, - 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, - 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, - 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, - 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, - 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, - 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, - 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, - 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, - 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, - 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, - 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, - 1664409600000 - ], - "values": [ - 54820.03373164987, - 55218.99471220384, - 55071.49928878831, - 54949.78353754613, - 54792.09863487236, - 54758.23014110582, - 54839.84122407719, - 55080.79677446355, - 54553.826345367015, - 54700.14292835205, - 54737.2003722548, - 55002.27033954363, - 54777.74025995784, - 54920.93069442279, - 54564.00216313528, - 55127.85502136979, - 54649.187273431846, - 54903.09771335987, - 54811.92754307572, - 54954.78607277203, - 55320.74452442934, - 54811.32374927372, - 54789.12016856007, - 54832.67417526022, - 54882.66109509589, - 54839.12680134036, - 54963.65066827593, - 54833.89919248517, - 54726.41233535216, - 54711.6734476709, - 55050.82096058733, - 54804.508598504384, - 55043.67518606438, - 54909.71511835754, - 54832.34011665316, - 54965.59893223934, - 54768.34111642939, - 54769.87290857302, - 54838.65544370555, - 54639.0661843702, - 54871.37265354548, - 54877.451343791385, - 54884.69594899173, - 54830.335242511755, - 54909.95975180857, - 54729.30936347974, - 54857.07455554992, - 54773.180566804505, - 57040.51818064292, - 54815.08510582958, - 54638.81806222, - 54931.655559810424, - 54822.79794409753, - 54943.88083062903, - 59189.65722406022, - 54863.39737403222, - 54865.96204806309, - 54941.49568657858, - 55013.6698386867, - 54927.511166520126, - 55034.0434218988, - 54726.585503515416, - 55179.36971275004, - 55140.22470784515, - 54873.353515106246, - 55046.39285477691, - 55219.21159741783, - 53953.047819327396, - 54398.93323329027, - 54638.48781541484, - 55437.86906753935, - 54777.13448401533, - 54614.82884669915, - 54741.899303641876, - 54811.067369581295, - 54589.01308088208, - 55234.24117269804, - 54332.28349304332, - 54490.19518987563, - 54634.571387632306, - 54716.22231328921, - 56106.07520870239, - 54878.24152910459, - 55026.275312892016, - 54081.654492523165, - 55144.45957110088, - 56071.58167898117, - 54385.870900343165, - 54458.36845208812, - 54230.56669550621, - 54258.731741534466, - 55081.29456308478, - 55865.60168431374, - 55196.5338318562, - 53852.42383215121, - 55496.39855469356, - 55323.17160213487, - 54835.549739796435, - 55074.18764280705, - 54714.90320689123, - 55315.876354608066, - 54894.23055589334, - 54762.26818212387, - 54519.16418366507, - 55263.627200541814, - 54644.019993779904, - 54705.427177621474, - 55111.50943922037, - 54662.1410122232, - 54391.73053502808, - 53794.626921183415, - 54720.05095351137, - 54882.17257639208, - 54895.636923092046, - 54843.223935575785, - 55041.561428220484, - 54674.520597537055, - 54655.125680576966, - 54893.71445497061, - 54744.62396520675, - 54977.05859708377, - 55160.030160401315, - 54764.61432756854, - 54725.26721258407, - 55183.882339578675, - 55129.065580386196, - 54626.46311949491, - 54849.14344749185, - 54963.18046961137, - 54816.06156961105, - 54733.57320804991, - 55447.00928208658, - 55124.80110455526, - 55027.30869873211, - 54987.10183916898, - 55062.99573491732, - 53716.04621333344, - 55011.03937116556, - 54764.56758589279, - 54588.83623561774, - 54533.389405348695, - 54877.71688140235, - 54616.27774406533, - 55079.69618901161 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_query2.json deleted file mode 100644 index ff5a9bdce..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.4285E-4, - "dimensionCountRatio": 0.04857, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48858596068 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_units_convert_error.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_units_convert_error.json deleted file mode 100644 index 72cecf571..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_error/metrics_units_convert_error.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": 400, - "message": "Cannot convert MicroSecond to Byte." - } -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_query2.json deleted file mode 100644 index f4a6fff0e..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/auto/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.435E-4, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48640187603 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/dashboard.template.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/dashboard.template.json deleted file mode 100644 index acb2042df..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/dashboard.template.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "metadata": { - "configurationVersions": [ - 5 - ], - "clusterVersion": "1.232.0.20211118-204216" - }, - "id": "12345678-1111-4444-8888-123456789012", - "dashboardMetadata": { - "name": "Management Zone Test", - "shared": false, - "owner": "", - "popularity": 1 - }, - "tiles": [ - { - "name": "SRT", - "tileType": "DATA_EXPLORER", - "configured": true, - "bounds": { - "top": 76, - "left": 114, - "width": 304, - "height": 304 - }, - "tileFilter": {}, - "customName": "Data explorer results", - "queries": [ - { - "id": "A", - "metric": "builtin:service.response.time", - "spaceAggregation": "AVG", - "timeAggregation": "DEFAULT", - "splitBy": [], - "filterBy": { - "nestedFilters": [], - "criteria": [] - }, - "enabled": true - } - ], - "visualConfig": { - "type": "GRAPH_CHART", - "global": { - "hideLegend": false - }, - "rules": [ - { - "matcher": "A:", - "unitTransform": "{{.Unit}}", - "valueFormat": "auto", - "properties": { - "color": "DEFAULT", - "seriesType": "LINE" - }, - "seriesOverrides": [] - } - ], - "axes": { - "xAxis": { - "displayName": "", - "visible": true - }, - "yAxes": [ - { - "displayName": "", - "visible": true, - "min": "AUTO", - "max": "AUTO", - "position": "LEFT", - "queryIds": [ - "A" - ], - "defaultAxis": true - } - ] - }, - "heatmapSettings": { - "yAxis": "VALUE" - }, - "thresholds": [ - { - "axisTarget": "LEFT", - "rules": [ - { - "color": "#7dc540" - }, - { - "color": "#f5d30f" - }, - { - "color": "#dc172a" - } - ], - "queryId": "", - "visible": true - } - ], - "tableSettings": { - "isThresholdBackgroundAppliedToCell": false - }, - "graphChartSettings": { - "connectNulls": false - }, - "honeycombSettings": { - "showHive": true, - "showLegend": true, - "showLabels": false - } - }, - "metricExpressions": [ - "resolution=null&(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names" - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_id.json deleted file mode 100644 index cd0c350cb..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_get_by_id.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "displayName": "Response time", - "description": "", - "unit": "MicroSecond", - "dduBillable": false, - "created": 0, - "lastWritten": null, - "entityType": [ - "SERVICE" - ], - "aggregationTypes": [ - "auto", - "value" - ], - "transformations": [ - "fold", - "limit", - "timeshift", - "rate", - "sort", - "last", - "splitBy", - "default", - "delta", - "lastReal", - "smooth", - "rollup", - "partition", - "toUnit", - "setUnit" - ], - "defaultAggregation": { - "type": "value" - }, - "dimensionDefinitions": [], - "tags": [], - "metricValueType": { - "type": "unknown" - }, - "scalar": false, - "resolutionInfSupported": true, - "warnings": [ - "The field dimensionCardinalities is only supported for untransformed single metric keys and was ignored." - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_units_convert1.json deleted file mode 100644 index ea6672218..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/day/metrics_units_convert1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "unitId": "Day", - "resultValue": 6.353760000217132E-7 -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_id.json deleted file mode 100644 index cd0c350cb..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_id.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "displayName": "Response time", - "description": "", - "unit": "MicroSecond", - "dduBillable": false, - "created": 0, - "lastWritten": null, - "entityType": [ - "SERVICE" - ], - "aggregationTypes": [ - "auto", - "value" - ], - "transformations": [ - "fold", - "limit", - "timeshift", - "rate", - "sort", - "last", - "splitBy", - "default", - "delta", - "lastReal", - "smooth", - "rollup", - "partition", - "toUnit", - "setUnit" - ], - "defaultAggregation": { - "type": "value" - }, - "dimensionDefinitions": [], - "tags": [], - "metricValueType": { - "type": "unknown" - }, - "scalar": false, - "resolutionInfSupported": true, - "warnings": [ - "The field dimensionCardinalities is only supported for untransformed single metric keys and was ignored." - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_query1.json deleted file mode 100644 index d4e71bd66..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_query1.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "1h", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.005844, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664326800000, - 1664330400000, - 1664334000000, - 1664337600000, - 1664341200000, - 1664344800000, - 1664348400000, - 1664352000000, - 1664355600000, - 1664359200000, - 1664362800000, - 1664366400000, - 1664370000000, - 1664373600000, - 1664377200000, - 1664380800000, - 1664384400000, - 1664388000000, - 1664391600000, - 1664395200000, - 1664398800000, - 1664402400000, - 1664406000000, - 1664409600000 - ], - "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.86675170188, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47957807731, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_query2.json deleted file mode 100644 index f4a6fff0e..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/empty/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.435E-4, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48640187603 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_id.json deleted file mode 100644 index cd0c350cb..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_id.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "displayName": "Response time", - "description": "", - "unit": "MicroSecond", - "dduBillable": false, - "created": 0, - "lastWritten": null, - "entityType": [ - "SERVICE" - ], - "aggregationTypes": [ - "auto", - "value" - ], - "transformations": [ - "fold", - "limit", - "timeshift", - "rate", - "sort", - "last", - "splitBy", - "default", - "delta", - "lastReal", - "smooth", - "rollup", - "partition", - "toUnit", - "setUnit" - ], - "defaultAggregation": { - "type": "value" - }, - "dimensionDefinitions": [], - "tags": [], - "metricValueType": { - "type": "unknown" - }, - "scalar": false, - "resolutionInfSupported": true, - "warnings": [ - "The field dimensionCardinalities is only supported for untransformed single metric keys and was ignored." - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_query1.json deleted file mode 100644 index d4e71bd66..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_query1.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "1h", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.005844, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664326800000, - 1664330400000, - 1664334000000, - 1664337600000, - 1664341200000, - 1664344800000, - 1664348400000, - 1664352000000, - 1664355600000, - 1664359200000, - 1664362800000, - 1664366400000, - 1664370000000, - 1664373600000, - 1664377200000, - 1664380800000, - 1664384400000, - 1664388000000, - 1664391600000, - 1664395200000, - 1664398800000, - 1664402400000, - 1664406000000, - 1664409600000 - ], - "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.86675170188, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47957807731, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_query2.json deleted file mode 100644 index f4a6fff0e..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/microsecond/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.435E-4, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48640187603 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_id.json deleted file mode 100644 index cd0c350cb..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_id.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "displayName": "Response time", - "description": "", - "unit": "MicroSecond", - "dduBillable": false, - "created": 0, - "lastWritten": null, - "entityType": [ - "SERVICE" - ], - "aggregationTypes": [ - "auto", - "value" - ], - "transformations": [ - "fold", - "limit", - "timeshift", - "rate", - "sort", - "last", - "splitBy", - "default", - "delta", - "lastReal", - "smooth", - "rollup", - "partition", - "toUnit", - "setUnit" - ], - "defaultAggregation": { - "type": "value" - }, - "dimensionDefinitions": [], - "tags": [], - "metricValueType": { - "type": "unknown" - }, - "scalar": false, - "resolutionInfSupported": true, - "warnings": [ - "The field dimensionCardinalities is only supported for untransformed single metric keys and was ignored." - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_query1.json deleted file mode 100644 index d4e71bd66..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_query1.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "1h", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.005844, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664326800000, - 1664330400000, - 1664334000000, - 1664337600000, - 1664341200000, - 1664344800000, - 1664348400000, - 1664352000000, - 1664355600000, - 1664359200000, - 1664362800000, - 1664366400000, - 1664370000000, - 1664373600000, - 1664377200000, - 1664380800000, - 1664384400000, - 1664388000000, - 1664391600000, - 1664395200000, - 1664398800000, - 1664402400000, - 1664406000000, - 1664409600000 - ], - "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.86675170188, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47957807731, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_query2.json deleted file mode 100644 index f4a6fff0e..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.435E-4, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48640187603 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_units_convert1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_units_convert1.json deleted file mode 100644 index a6f523558..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/millisecond/metrics_units_convert1.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "unitId": "MilliSecond", - "resultValue": 54.896486401876025 -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_id.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_id.json deleted file mode 100644 index cd0c350cb..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_id.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "displayName": "Response time", - "description": "", - "unit": "MicroSecond", - "dduBillable": false, - "created": 0, - "lastWritten": null, - "entityType": [ - "SERVICE" - ], - "aggregationTypes": [ - "auto", - "value" - ], - "transformations": [ - "fold", - "limit", - "timeshift", - "rate", - "sort", - "last", - "splitBy", - "default", - "delta", - "lastReal", - "smooth", - "rollup", - "partition", - "toUnit", - "setUnit" - ], - "defaultAggregation": { - "type": "value" - }, - "dimensionDefinitions": [], - "tags": [], - "metricValueType": { - "type": "unknown" - }, - "scalar": false, - "resolutionInfSupported": true, - "warnings": [ - "The field dimensionCardinalities is only supported for untransformed single metric keys and was ignored." - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_query1.json deleted file mode 100644 index d4e71bd66..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_query1.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "1h", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.005844, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664326800000, - 1664330400000, - 1664334000000, - 1664337600000, - 1664341200000, - 1664344800000, - 1664348400000, - 1664352000000, - 1664355600000, - 1664359200000, - 1664362800000, - 1664366400000, - 1664370000000, - 1664373600000, - 1664377200000, - 1664380800000, - 1664384400000, - 1664388000000, - 1664391600000, - 1664395200000, - 1664398800000, - 1664402400000, - 1664406000000, - 1664409600000 - ], - "values": [ - 54934.93891767586, - 54818.50756764941, - 54821.86675170188, - 54919.61362203189, - 54826.16586296582, - 54934.41099954065, - 54794.097577394925, - 54830.75287658759, - 55198.896436065304, - 55632.898850914644, - 55000.06594579724, - 54738.599623082286, - 54720.294205590835, - 54973.13689063351, - 54724.046913941915, - 54956.60080810572, - 55026.267778320114, - 54834.40420610275, - 54558.368537797556, - 54808.61520734298, - 54989.47957807731, - 54904.36234832176, - 54824.22258908881, - 54742.91667039969 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_query2.json deleted file mode 100644 index f4a6fff0e..000000000 --- a/internal/sli/testdata/dashboards/data_explorer/unit_transform_success/none/metrics_get_by_query2.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "totalCount": 1, - "nextPageKey": null, - "resolution": "Inf", - "result": [ - { - "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.435E-4, - "dimensionCountRatio": 0.0487, - "data": [ - { - "dimensions": [], - "dimensionMap": {}, - "timestamps": [ - 1664409600000 - ], - "values": [ - 54896.48640187603 - ] - } - ] - } - ] -} diff --git a/internal/sli/testdata/dashboards/slo_generation/data_explorer_tile_no_data/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/slo_generation/data_explorer_tile_no_data/metrics_get_by_query1.json index ebf63ab5d..330de2f12 100644 --- a/internal/sli/testdata/dashboards/slo_generation/data_explorer_tile_no_data/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/slo_generation/data_explorer_tile_no_data/metrics_get_by_query1.json @@ -1,7 +1,7 @@ { "totalCount": 0, "nextPageKey": null, - "resolution": "10m", + "resolution": "1h", "result": [ { "metricId": "(builtin:service.response.time:filter(and(or(in(\"dt.entity.service\",entitySelector(\"type(service),entityId(~\"SERVICE-C33B8A4C73748469~\")\"))))):splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", diff --git a/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_id.json b/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_id.json index cd0c350cb..9ebe8ff5c 100644 --- a/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_id.json +++ b/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_id.json @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query1.json b/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query1.json index ff8e4fa74..9ab9e7a95 100644 --- a/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query1.json +++ b/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query1.json @@ -1,307 +1,67 @@ { "totalCount": 1, "nextPageKey": null, - "resolution": "10m", + "resolution": "1h", "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 0.0695664, - "dimensionCountRatio": 0.04831, + "dataPointCountRatio": 0.0058476, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], "dimensionMap": {}, "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, 1664409600000 ], "values": [ - 54820.03373164987, - 55218.99471220384, - 55071.49928878831, - 54949.78353754613, - 54792.09863487236, - 54758.23014110582, - 54839.84122407719, - 55080.79677446355, - 54553.826345367015, - 54700.14292835205, - 54737.24443526918, - 55002.27033954363, - 54777.74025995784, - 54920.93069442279, - 54564.00216313528, - 55127.85502136979, - 54649.190982801614, - 54903.09771335987, - 54811.92754307572, - 54954.78607277203, - 55320.74452442934, - 54811.33119424702, - 54789.12016856007, - 54832.67417526022, - 54882.66109509589, - 54839.12680134036, - 54963.65066827593, - 54833.89919248517, - 54726.41233535216, - 54711.6734476709, - 55050.82096058733, - 54804.508598504384, - 55043.67518606438, - 54909.71511835754, - 54832.34011665316, - 54965.59893223934, - 54768.34111642939, - 54769.87290857302, - 54838.65544370555, - 54639.07917105979, - 54871.37265354548, - 54877.451343791385, - 54884.69594899173, - 54830.335242511755, - 54909.95975180857, - 54729.30936347974, - 54857.07455554992, - 54773.180566804505, - 57040.51818064292, - 54815.08510582958, - 54638.81806222, - 54931.655559810424, - 54822.79794409753, - 54943.88083062903, - 59189.65722406022, - 54863.39737403222, - 54865.96204806309, - 54941.49568657858, - 55013.6698386867, - 54927.525870802885, - 55034.0434218988, - 54726.585503515416, - 55179.36971275004, - 55140.22470784515, - 54873.353515106246, - 55046.39285477691, - 55219.21537555057, - 53953.047819327396, - 54398.9508502607, - 54638.48781541484, - 55437.882971776, - 54777.13448401533, - 54614.82884669915, - 54741.899303641876, - 54811.067369581295, - 54589.01308088208, - 55234.24117269804, - 54332.28349304332, - 54490.19518987563, - 54634.571387632306, - 54716.22231328921, - 56106.07520870239, - 54878.406243338446, - 55026.275312892016, - 54081.654492523165, - 55144.464852737714, - 56071.58167898117, - 54385.870900343165, - 54458.36845208812, - 54230.56669550621, - 54258.73541804073, - 55081.29456308478, - 55865.60168431374, - 55196.5338318562, - 53852.42383215121, - 55496.39855469356, - 55323.17160213487, - 54835.549739796435, - 55074.18764280705, - 54714.90320689123, - 55317.50371785831, - 54894.23055589334, - 54762.523048038885, - 54519.16418366507, - 55263.627200541814, - 54644.008772321096, - 54705.43088113213, - 55111.565008881116, - 54662.14843297262, - 54391.73053502808, - 53794.655916324446, - 54720.05095351137, - 54882.179775951736, - 54895.636923092046, - 54843.223935575785, - 55041.561428220484, - 54674.520597537055, - 54655.125680576966, - 54893.71445497061, - 54744.62396520675, - 54977.05859708377, - 55160.030160401315, - 54764.61432756854, - 54725.26721258407, - 55183.882339578675, - 55129.065580386196, - 54626.46311949491, - 54849.14344749185, - 54963.19541985402, - 54816.06156961105, - 54733.57320804991, - 55447.00928208658, - 55124.80110455526, - 55027.30869873211, - 54987.10183916898, - 55062.99573491732, - 53716.053450616135, - 55011.04684473182, - 54764.571123708745, - 54588.83623561774, - 54533.389405348695, - 54877.71688140235, - 54616.27774406533, - 55079.69618901161 + 54934.93891767586, + 54818.50756764941, + 54821.84842054894, + 54919.61362203189, + 54826.16586296582, + 54934.41099954065, + 54794.097577394925, + 54830.75287658759, + 55198.896436065304, + 55632.898850914644, + 55000.06594579724, + 54738.599623082286, + 54720.294205590835, + 54973.13689063351, + 54724.046913941915, + 54956.60080810572, + 55026.267778320114, + 54834.40420610275, + 54558.368537797556, + 54808.61520734298, + 54989.47337630238, + 54904.357616097506, + 54824.22258908881, + 54742.91667039969 ] } ] diff --git a/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query2.json b/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query2.json index 7296e0552..f123dbd00 100644 --- a/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query2.json +++ b/internal/sli/testdata/dashboards/slo_generation/supported_data_explorer_tile/metrics_get_by_query2.json @@ -5,8 +5,8 @@ "result": [ { "metricId": "(builtin:service.response.time:splitBy():avg:auto:sort(value(avg,descending)):limit(10)):limit(100):names", - "dataPointCountRatio": 2.4155E-4, - "dimensionCountRatio": 0.04831, + "dataPointCountRatio": 2.4365E-4, + "dimensionCountRatio": 0.04873, "data": [ { "dimensions": [], @@ -15,7 +15,7 @@ 1664409600000 ], "values": [ - 54896.50447404383 + 54896.485186544574 ] } ] diff --git a/internal/sli/testdata/sli_files/basic/success/metrics_get_by_id.json b/internal/sli/testdata/sli_files/basic/success/metrics_get_by_id.json index 1510ea0ff..c2e2d2efd 100644 --- a/internal/sli/testdata/sli_files/basic/success/metrics_get_by_id.json +++ b/internal/sli/testdata/sli_files/basic/success/metrics_get_by_id.json @@ -5,7 +5,7 @@ "unit": "MicroSecond", "dduBillable": false, "created": 0, - "lastWritten": 1665644026995, + "lastWritten": 1674728863687, "entityType": [ "SERVICE" ], @@ -38,6 +38,7 @@ "metricValueType": { "type": "unknown" }, + "minimumValue": 0.0, "scalar": false, "resolutionInfSupported": true, "warnings": [ diff --git a/internal/sli/testdata/sli_files/basic/success/metrics_get_by_query1.json b/internal/sli/testdata/sli_files/basic/success/metrics_get_by_query1.json index 96dd6be9b..93115adb3 100644 --- a/internal/sli/testdata/sli_files/basic/success/metrics_get_by_query1.json +++ b/internal/sli/testdata/sli_files/basic/success/metrics_get_by_query1.json @@ -1,307 +1,67 @@ { "totalCount": 1, "nextPageKey": null, - "resolution": "10m", + "resolution": "1h", "result": [ { "metricId": "builtin:service.response.time:merge(\"dt.entity.service\"):percentile(95)", - "dataPointCountRatio": 4.32E-5, + "dataPointCountRatio": 3.6E-6, "dimensionCountRatio": 3.0E-5, "data": [ { "dimensions": [], "dimensionMap": {}, "timestamps": [ - 1664323800000, - 1664324400000, - 1664325000000, - 1664325600000, - 1664326200000, 1664326800000, - 1664327400000, - 1664328000000, - 1664328600000, - 1664329200000, - 1664329800000, 1664330400000, - 1664331000000, - 1664331600000, - 1664332200000, - 1664332800000, - 1664333400000, 1664334000000, - 1664334600000, - 1664335200000, - 1664335800000, - 1664336400000, - 1664337000000, 1664337600000, - 1664338200000, - 1664338800000, - 1664339400000, - 1664340000000, - 1664340600000, 1664341200000, - 1664341800000, - 1664342400000, - 1664343000000, - 1664343600000, - 1664344200000, 1664344800000, - 1664345400000, - 1664346000000, - 1664346600000, - 1664347200000, - 1664347800000, 1664348400000, - 1664349000000, - 1664349600000, - 1664350200000, - 1664350800000, - 1664351400000, 1664352000000, - 1664352600000, - 1664353200000, - 1664353800000, - 1664354400000, - 1664355000000, 1664355600000, - 1664356200000, - 1664356800000, - 1664357400000, - 1664358000000, - 1664358600000, 1664359200000, - 1664359800000, - 1664360400000, - 1664361000000, - 1664361600000, - 1664362200000, 1664362800000, - 1664363400000, - 1664364000000, - 1664364600000, - 1664365200000, - 1664365800000, 1664366400000, - 1664367000000, - 1664367600000, - 1664368200000, - 1664368800000, - 1664369400000, 1664370000000, - 1664370600000, - 1664371200000, - 1664371800000, - 1664372400000, - 1664373000000, 1664373600000, - 1664374200000, - 1664374800000, - 1664375400000, - 1664376000000, - 1664376600000, 1664377200000, - 1664377800000, - 1664378400000, - 1664379000000, - 1664379600000, - 1664380200000, 1664380800000, - 1664381400000, - 1664382000000, - 1664382600000, - 1664383200000, - 1664383800000, 1664384400000, - 1664385000000, - 1664385600000, - 1664386200000, - 1664386800000, - 1664387400000, 1664388000000, - 1664388600000, - 1664389200000, - 1664389800000, - 1664390400000, - 1664391000000, 1664391600000, - 1664392200000, - 1664392800000, - 1664393400000, - 1664394000000, - 1664394600000, 1664395200000, - 1664395800000, - 1664396400000, - 1664397000000, - 1664397600000, - 1664398200000, 1664398800000, - 1664399400000, - 1664400000000, - 1664400600000, - 1664401200000, - 1664401800000, 1664402400000, - 1664403000000, - 1664403600000, - 1664404200000, - 1664404800000, - 1664405400000, 1664406000000, - 1664406600000, - 1664407200000, - 1664407800000, - 1664408400000, - 1664409000000, 1664409600000 ], "values": [ - null, - null, - 644, - 640, - 854, 931, - 846, - 1166152, - 642, - 650, - 888, - 785, - null, - 570, - 571, - 574, + 29712, 670, - 614, - null, - null, - null, - null, - 638, 764, - 494, - null, - 721, - null, 740, - null, - null, 629, - null, - null, - 507, - 543, - null, - null, 668, - null, - null, - null, 766, - 570, - null, - 602, - 511, - null, - null, - null, - 624, - 528, 727, - null, - null, - null, - null, - 566, - null, 762, - null, 2445, - 592.3000000000001, - null, - 549, - null, - 715, - null, - null, - null, - 570, - null, - null, - null, - null, + 700.4999999999999, 621, - null, - null, - null, - null, - 819, - 41052.5, - 520, 28548, - 639, 904, - 555, - null, - null, - null, - 651.8, - 663, - 684.8, - 18180.8, - 621, - null, - 614, - null, - 720, + 8472.999999999973, 758, - 590, - null, - 619, - 580, - null, - 490.95, - 2038121, - 18908, - 762, - 553, + 1028514.5, 770, - null, - 709, - null, - null, - null, - null, 607, - 580, - 558, - 760, - 523, - 647, - null, 782, - 620, 830, - 517, - 528, - null, - null, - 737, - 518, 1287283, - null, - 734, - 851, - null, - 449, - null, - 719, - null, - null, - 653 + 719 ] } ] diff --git a/internal/test/dynatrace_test_file_updater.go b/internal/test/dynatrace_test_file_updater.go index af4c894a5..f12708433 100644 --- a/internal/test/dynatrace_test_file_updater.go +++ b/internal/test/dynatrace_test_file_updater.go @@ -82,21 +82,20 @@ func (h *dynatraceTestFileUpdater) tryUpdateTestFileUsingGet(url string, filenam response, status, _, err := h.client.Get(context.TODO(), url) if !assert.NoError(h.t, err, "REST client get should not produce an error") || - !assert.EqualValues(h.t, 200, status, "HTTP response status code should be 200") { + !assert.EqualValues(h.t, 200, status, fmt.Sprintf("HTTP response status code should be 200 but was %d with: %s", status, string(response))) { return } - os.WriteFile(filename, response, 0666) + err = os.WriteFile(filename, response, 0666) + assert.NoError(h.t, err) } func shouldUpdateFileForURL(url string) bool { return strings.HasPrefix(url, "/api/v2/metrics") || - strings.HasPrefix(url, "/api/v2/units") || strings.HasPrefix(url, "/api/v2/slo") || strings.HasPrefix(url, "/api/v2/problems") || strings.HasPrefix(url, "/api/v1/userSessionQueryLanguage/table") || strings.HasPrefix(url, "/api/v2/securityProblems") - } func createClient() *http.Client { diff --git a/internal/test/payload_based_url_handler.go b/internal/test/payload_based_url_handler.go index 10086728b..2678b8c69 100644 --- a/internal/test/payload_based_url_handler.go +++ b/internal/test/payload_based_url_handler.go @@ -2,7 +2,6 @@ package test import ( "net/http" - "strings" "testing" log "github.com/sirupsen/logrus" @@ -14,20 +13,16 @@ type errConfigForPayload struct { } type PayloadBasedURLHandler struct { - exactURLs map[string][]byte - exactErrorURLs map[string]errConfigForPayload - startsWithURLs map[string][]byte - startsWithErrorURLs map[string]errConfigForPayload - t *testing.T + exactURLs map[string][]byte + exactErrorURLs map[string]errConfigForPayload + t *testing.T } func NewPayloadBasedURLHandler(t *testing.T) *PayloadBasedURLHandler { return &PayloadBasedURLHandler{ - exactURLs: make(map[string][]byte), - exactErrorURLs: make(map[string]errConfigForPayload), - startsWithURLs: make(map[string][]byte), - startsWithErrorURLs: make(map[string]errConfigForPayload), - t: t, + exactURLs: make(map[string][]byte), + exactErrorURLs: make(map[string]errConfigForPayload), + t: t, } } @@ -49,24 +44,6 @@ func (h *PayloadBasedURLHandler) AddExactError(url string, statusCode int, paylo h.exactErrorURLs[url] = errConfigForPayload{status: statusCode, payload: payload} } -func (h *PayloadBasedURLHandler) AddStartsWith(url string, payload []byte) { - _, isSet := h.startsWithURLs[url] - if isSet { - log.WithField(urlFieldName, url).Warn("Replacing the payload for starts with URL match") - } - - h.startsWithURLs[url] = payload -} - -func (h *PayloadBasedURLHandler) AddStartsWithError(url string, statusCode int, payload []byte) { - _, isSet := h.startsWithErrorURLs[url] - if isSet { - log.WithField(urlFieldName, url).Warn("Replacing the payload for starts with error URL match") - } - - h.startsWithErrorURLs[url] = errConfigForPayload{status: statusCode, payload: payload} -} - func (h *PayloadBasedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { requestedURL := r.URL.String() log.WithField(urlFieldName, requestedURL).Debug("Mock requested for URL") @@ -80,15 +57,6 @@ func (h *PayloadBasedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques } } - for url, payload := range h.startsWithURLs { - if strings.Index(requestedURL, url) == 0 { - log.WithField(urlFieldName, url).Debug("Found mock for starts with URL") - - writePayloadToResponseWriter(w, http.StatusOK, payload) - return - } - } - for url, config := range h.exactErrorURLs { if url == requestedURL { log.WithField(urlFieldName, url).Debug("Found mock for exact error URL") @@ -98,15 +66,6 @@ func (h *PayloadBasedURLHandler) ServeHTTP(w http.ResponseWriter, r *http.Reques } } - for url, config := range h.startsWithErrorURLs { - if strings.Index(requestedURL, url) == 0 { - log.WithField(urlFieldName, url).Debug("Found mock for starts with error URL") - - writePayloadToResponseWriter(w, config.status, config.payload) - return - } - } - h.t.Fatalf("no path defined for: %s", requestedURL) }