From 0dff300686690a0fd2f0347a8a9d0ceb7c68b2c0 Mon Sep 17 00:00:00 2001 From: "Maxim.Kolmakov" Date: Tue, 14 Nov 2023 12:37:30 +0100 Subject: [PATCH] Remove raw reports from collector They are very heavy and rarely used --- cmd/transform/transform.go | 10 +--------- pkg/analyzer/InsertReportManager.go | 6 ------ pkg/analyzer/analyzer.go | 5 ----- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/cmd/transform/transform.go b/cmd/transform/transform.go index a4654d71..4577bfc4 100644 --- a/cmd/transform/transform.go +++ b/cmd/transform/transform.go @@ -199,14 +199,9 @@ func process(taskContext context.Context, db driver.Conn, config analyzer.Databa if config.HasInstallerField { installerFields = "tc_installer_build_id, " + buildFields } - rawReportField := "" - if config.HasRawReport { - rawReportField = "raw_report," - } rows, err = db.Query(taskContext, ` select machine, branch, - generated_time, build_time, `+rawReportField+` - tc_build_id,`+installerFields+` project, measures.name, measures.value, measures.type, triggeredBy + generated_time, build_time, tc_build_id,`+installerFields+` project, measures.name, measures.value, measures.type, triggeredBy from `+tableName+` where generated_time >= $1 and generated_time < $2 order by machine, branch, project, `+buildFields+` build_time, generated_time @@ -234,9 +229,6 @@ rowLoop: TcBuildId: int(row.TcBuildId), } - if config.HasRawReport { - runResult.RawReport = []byte(row.RawReport) - } if config.HasInstallerField { runResult.TcInstallerBuildId = int(row.TcInstallerBuildId) runResult.BuildC1 = int(row.BuildC1) diff --git a/pkg/analyzer/InsertReportManager.go b/pkg/analyzer/InsertReportManager.go index 4ddcadcc..fc9e02e4 100644 --- a/pkg/analyzer/InsertReportManager.go +++ b/pkg/analyzer/InsertReportManager.go @@ -80,9 +80,6 @@ func NewInsertReportManager(context context.Context, db driver.Conn, config Data if config.HasInstallerField { metaFields = append(metaFields, "build_time", "tc_installer_build_id", "build_c1", "build_c2", "build_c3") } - if config.HasRawReport { - metaFields = append(metaFields, "raw_report") - } if config.HasBuildNumber { metaFields = append(metaFields, "build_number") } @@ -264,9 +261,6 @@ func (t *InsertReportManager) WriteMetrics(product string, row *RunResult, branc } args = append(args, buildTimeUnix, uint32(row.TcInstallerBuildId), uint8(row.BuildC1), uint16(row.BuildC2), uint16(row.BuildC3)) } - if t.config.HasRawReport { - args = append(args, string(row.RawReport)) - } if t.config.HasBuildNumber { args = append(args, row.BuildNumber) } diff --git a/pkg/analyzer/analyzer.go b/pkg/analyzer/analyzer.go index 1f23e817..4a9661d9 100644 --- a/pkg/analyzer/analyzer.go +++ b/pkg/analyzer/analyzer.go @@ -39,7 +39,6 @@ func GetAnalyzer(id string) DatabaseConfiguration { DbName: id, HasProductField: true, HasInstallerField: true, - HasRawReport: true, extraFieldCount: len(IjMetricDescriptors) + len(fieldNames), ReportReader: analyzeIjReport, insertStatementWriter: func(sb *strings.Builder) { @@ -59,7 +58,6 @@ func GetAnalyzer(id string) DatabaseConfiguration { DbName: dbName, TableName: tableName, ReportReader: analyzePerfReport, - HasRawReport: false, HasBuildTypeField: true, HasMetaDB: true, HasNoInstallerButHasChanges: true, @@ -76,7 +74,6 @@ func GetAnalyzer(id string) DatabaseConfiguration { ReportReader: analyzePerfReport, HasInstallerField: true, HasBuildTypeField: true, - HasRawReport: false, HasMetaDB: true, extraFieldCount: 3, insertStatementWriter: func(sb *strings.Builder) { @@ -88,7 +85,6 @@ func GetAnalyzer(id string) DatabaseConfiguration { DbName: "fleet", ReportReader: analyzeFleetReport, HasInstallerField: true, - HasRawReport: false, extraFieldCount: 4, insertStatementWriter: func(sb *strings.Builder) { sb.WriteString(", measures.name, measures.value, measures.start, measures.thread") @@ -137,7 +133,6 @@ func GetAnalyzer(id string) DatabaseConfiguration { DbName: "perfUnitTests", TableName: "report", ReportReader: analyzePerfReport, - HasRawReport: false, HasBuildTypeField: true, HasMetaDB: false, HasNoInstallerButHasChanges: true,