Skip to content

Commit

Permalink
Remove raw reports from collector
Browse files Browse the repository at this point in the history
They are very heavy and rarely used
  • Loading branch information
MaXal committed Nov 14, 2023
1 parent f849b44 commit 0dff300
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
10 changes: 1 addition & 9 deletions cmd/transform/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions pkg/analyzer/InsertReportManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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)
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -59,7 +58,6 @@ func GetAnalyzer(id string) DatabaseConfiguration {
DbName: dbName,
TableName: tableName,
ReportReader: analyzePerfReport,
HasRawReport: false,
HasBuildTypeField: true,
HasMetaDB: true,
HasNoInstallerButHasChanges: true,
Expand All @@ -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) {
Expand All @@ -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")
Expand Down Expand Up @@ -137,7 +133,6 @@ func GetAnalyzer(id string) DatabaseConfiguration {
DbName: "perfUnitTests",
TableName: "report",
ReportReader: analyzePerfReport,
HasRawReport: false,
HasBuildTypeField: true,
HasMetaDB: false,
HasNoInstallerButHasChanges: true,
Expand Down

0 comments on commit 0dff300

Please sign in to comment.