Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not to return an error when the data point of metrics was empty #3663

Merged
merged 4 commits into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkg/app/piped/analysisprovider/metrics/datadog/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ func (p *Provider) QueryPoints(ctx context.Context, query string, queryRange met
if httpResp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("unexpected HTTP status code from %s: %d", httpResp.Request.URL, httpResp.StatusCode)
}
if resp.Series == nil || len(*resp.Series) == 0 {
return nil, fmt.Errorf("no query metadata found: %w", metrics.ErrNoDataFound)
}

// Collect data points given by the provider.
var size int
Expand Down
4 changes: 4 additions & 0 deletions pkg/app/piped/executor/analysis/metrics_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,11 @@ func (a *metricsAnalyzer) analyzeWithCanaryPrimary(ctx context.Context) (bool, e

// compare compares the given two samples using Mann-Whitney U test.
// Considered as failure if it deviates in the specified direction as the third argument.
// If both of the point values is empty, this returns true.
func compare(experiment, control []float64, deviation string) (acceptable bool, err error) {
if len(experiment) == 0 && len(control) == 0 {
return true, nil
}
knanao marked this conversation as resolved.
Show resolved Hide resolved
if len(experiment) == 0 {
return false, fmt.Errorf("no data points of Experiment found")
}
Expand Down