diff --git a/internal/occurrence/occurrence.go b/internal/occurrence/occurrence.go index a5ca80a..854b855 100644 --- a/internal/occurrence/occurrence.go +++ b/internal/occurrence/occurrence.go @@ -90,9 +90,12 @@ const ( FrameDropType Type = 2008 FrameRegressionExpType Type = 2010 - EvidenceNameDuration EvidenceName = "Duration" - EvidenceNameFunction EvidenceName = "Suspect function" - EvidenceNamePackage EvidenceName = "Package" + EvidenceNameDuration EvidenceName = "Duration" + EvidenceNameFunction EvidenceName = "Suspect function" + EvidenceNamePackage EvidenceName = "Package" + EvidenceFullyQualifiedName EvidenceName = "Fully qualified name" + EvidenceBreakpoint EvidenceName = "Breakpoint" + EvidenceRegression EvidenceName = "Regression" ContextTrace Context = "trace" @@ -202,14 +205,15 @@ func FromRegressedFunction(p profile.Profile, regressed RegressedFunction, f fra pf = platform.Java } + fullyQualifiedName := f.FullyQualifiedName(pf) now := time.Now().UTC() fingerprint := fmt.Sprintf("%x", regressed.Fingerprint) beforeP95 := time.Duration(regressed.AggregateRange1).Round(10 * time.Microsecond) afterP95 := time.Duration(regressed.AggregateRange2).Round(10 * time.Microsecond) - subtitle := fmt.Sprintf("P95 frame duration increased from %s to %s.", beforeP95, afterP95) + regressionText := fmt.Sprintf("P95 frame duration increased from %s to %s.", beforeP95, afterP95) return &Occurrence{ - Culprit: f.FullyQualifiedName(pf), + Culprit: fullyQualifiedName, DetectionTime: now, Event: Event{ ID: eventID(), @@ -243,14 +247,28 @@ func FromRegressedFunction(p profile.Profile, regressed RegressedFunction, f fra "unweighted_p_value": regressed.UnweightedPValue, "unweighted_t_value": regressed.UnweightedTValue, }, - EvidenceDisplay: []Evidence{}, - Fingerprint: []string{fingerprint}, - ID: eventID(), - IssueTitle: "Frame Duration Regression", - Level: "info", - ProjectID: regressed.ProjectID, - Subtitle: subtitle, - Type: FrameRegressionExpType, + EvidenceDisplay: []Evidence{ + { + Important: true, + Name: EvidenceRegression, + Value: regressionText, + }, + { + Name: EvidenceBreakpoint, + Value: strconv.FormatUint(regressed.Breakpoint, 10), + }, + { + Name: EvidenceFullyQualifiedName, + Value: fullyQualifiedName, + }, + }, + Fingerprint: []string{fingerprint}, + ID: eventID(), + IssueTitle: "Frame Duration Regression", + Level: "info", + ProjectID: regressed.ProjectID, + Subtitle: regressionText, + Type: FrameRegressionExpType, } } diff --git a/internal/occurrence/regressed_frame.go b/internal/occurrence/regressed_frame.go index 9c1f7e8..9bb5d7e 100644 --- a/internal/occurrence/regressed_frame.go +++ b/internal/occurrence/regressed_frame.go @@ -20,7 +20,7 @@ type RegressedFunction struct { AbsolutePercentageChange float64 `json:"absolute_percentage_change"` AggregateRange1 float64 `json:"aggregate_range_1"` AggregateRange2 float64 `json:"aggregate_range_2"` - Breakpoint int64 `json:"breakpoint"` + Breakpoint uint64 `json:"breakpoint"` TrendDifference float64 `json:"trend_difference"` TrendPercentage float64 `json:"trend_percentage"` UnweightedPValue float64 `json:"unweighted_p_value"`