Skip to content

Commit

Permalink
Add analysis for fleet perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaXal committed Sep 17, 2024
1 parent 0c28915 commit e1cf7d1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmd/degradation-detector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ func generatePerformanceSettings(backendUrl string, client *http.Client) []detec
setting.GeneratePhpStormSettings(backendUrl, client),
setting.GenerateUnitTestsSettings(backendUrl, client),
setting.GenerateGolandPerfSettings(backendUrl, client),
setting.GenerateFleetPerformanceSettings(backendUrl, client),
)
}
59 changes: 59 additions & 0 deletions pkg/degradation-detector/setting/fleetPerformanceSettings.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package setting

import (
detector "github.com/JetBrains/ij-perf-report-aggregator/pkg/degradation-detector"
"log/slog"
"net/http"
"strings"
)

func GenerateFleetPerformanceSettings(backendUrl string, client *http.Client) []detector.PerformanceSettings {
settings := make([]detector.PerformanceSettings, 0, 100)
mainSettings := detector.PerformanceSettings{
Db: "fleet",
Table: "measure_new",
Branch: "master",
Machine: "intellij-linux-hw-hetzner%",
}
slackSettings := detector.SlackSettings{
Channel: "fleet-performance-tests-notifications",
ProductLink: "fleet",
}

tests, err := detector.FetchAllTests(backendUrl, client, mainSettings)
if err != nil {
slog.Error("error while getting tests", "error", err)
return settings
}
var filteredTests []string
for _, test := range tests {
if test != "" && !strings.Contains(test, "%20") && !strings.Contains(test, "agent-") {
filteredTests = append(filteredTests, test)
}
}

metrics := []string{"fleet.test", "p99"}

for _, test := range filteredTests {
for _, metric := range metrics {
settings = append(settings, detector.PerformanceSettings{
Db: mainSettings.Db,
Table: mainSettings.Table,
Branch: mainSettings.Branch,
Machine: mainSettings.Machine,
Metric: metric,
Project: test,

AnalysisSettings: detector.AnalysisSettings{
MinimumSegmentLength: 10,
MedianDifferenceThreshold: 5,
EffectSizeThreshold: 2,
ReportType: detector.AllEvent,
},
SlackSettings: slackSettings,
})
}
}

return settings
}

0 comments on commit e1cf7d1

Please sign in to comment.