Skip to content

PMM-15133 Re-design QANService for better performance#5463

Draft
ademidoff wants to merge 3 commits into
mainfrom
PMM-15133-redesign-qan-for-performance
Draft

PMM-15133 Re-design QANService for better performance#5463
ademidoff wants to merge 3 commits into
mainfrom
PMM-15133-redesign-qan-for-performance

Conversation

@ademidoff

@ademidoff ademidoff commented Jun 7, 2026

Copy link
Copy Markdown
Member

Ticket number: PMM-15133

Feature build: SUBMODULES-4395

@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.17216% with 106 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.30%. Comparing base (832eb3f) to head (3fd5c6f).

Files with missing lines Patch % Lines
agent/client/wal/wal.go 66.45% 32 Missing and 20 partials ⚠️
agent/client/client.go 27.41% 42 Missing and 3 partials ⚠️
...ent/agents/postgres/pgstatmonitor/pgstatmonitor.go 75.86% 4 Missing and 3 partials ⚠️
agent/agents/mysql/slowlog/slowlog.go 89.47% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v3    #5463      +/-   ##
==========================================
+ Coverage   43.13%   43.30%   +0.17%     
==========================================
  Files         413      414       +1     
  Lines       42394    42650     +256     
==========================================
+ Hits        18287    18470     +183     
- Misses      22235    22279      +44     
- Partials     1872     1901      +29     
Flag Coverage Δ
admin 34.71% <ø> (ø)
agent 49.70% <61.02%> (+0.53%) ⬆️
managed 42.25% <100.00%> (+<0.01%) ⬆️
vmproxy 72.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@percona-robot percona-robot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

golangci

🚫 [golangci] reported by reviewdog 🐶
named return "planid" with type "string" found (nonamedreturns)

func (r *Reporter) QueryPlan(ctx context.Context, queryid string) (planid, plan string, err error) {


🚫 [golangci] reported by reviewdog 🐶
named return "sum" with type "float64" found (nonamedreturns)

func (r *ReportRow) Metric(root string) (sum float64, cnt uint64, mn, mx float32, sketch map[uint16]uint64) {


🚫 [golangci] reported by reviewdog 🐶
named return "lo" with type "float64" found (nonamedreturns)

func BucketBounds(a int) (lo, hi float64) {


🚫 [golangci] reported by reviewdog 🐶
exported: exported const MaxValue should have comment (or a comment on this block) or be unexported (revive)

MaxValue = 1000.0


🚫 [golangci] reported by reviewdog 🐶
float-compare: use require.InEpsilon (or InDelta) (testifylint)

require.Equal(t, float64(8), nq)


🚫 [golangci] reported by reviewdog 🐶
float-compare: use assert.InEpsilon (or InDelta) (testifylint)

assert.Equal(t, float64(100), sums["rows_read"])


🚫 [golangci] reported by reviewdog 🐶
float-compare: use assert.InEpsilon (or InDelta) (testifylint)

assert.Equal(t, float64(2), sums["full_scan"])


🚫 [golangci] reported by reviewdog 🐶
len: use require.Len (testifylint)

require.Equal(t, Len(), len(New()))


🚫 [golangci] reported by reviewdog 🐶
float-compare: use assert.InEpsilon (or InDelta) (testifylint)

assert.Equal(t, Quantile(union, q), Quantile(merged, q))


🚫 [golangci] reported by reviewdog 🐶
float-compare: use require.InEpsilon (or InDelta) (testifylint)

require.Equal(t, MinValue, Quantile(counts, 0))


🚫 [golangci] reported by reviewdog 🐶
float-compare: use require.InEpsilon (or InDelta) (testifylint)

require.Equal(t, MaxValue, Quantile(counts, 1))


🚫 [golangci] reported by reviewdog 🐶
(*Service).GetMetricsNames - result 1 (error) is always nil (unparam)

func (s *Service) GetMetricsNames(_ context.Context, _ *qanv1.GetMetricsNamesRequest) (*qanv1.GetMetricsNamesResponse, error) {

Comment thread qan/models/ingestion.go
const (
dedupTTL = 3 * time.Minute
maxDedupEntries = 500000
// dedupHighWater is the size the cache is trimmed back to once it reaches the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
Sentence should start with a capital letter (godot)

ctx := t.Context()
ing := NewIngestor(conn)
rep := NewReporter(conn)
base := uint32(time.Now().UTC().Truncate(time.Hour).Add(-time.Hour).Unix())

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
G115: integer overflow conversion int64 -> uint32 (gosec)

Comment thread qan/models/sparklines.go
}
out = append(out, &qanv1.Point{
Point: point,
TimeFrame: uint32(tf),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
G115: integer overflow conversion int64 -> uint32 (gosec)

Comment thread qan/models/ingestion.go
"`database`", "`schema`", "username", "client_host",
"cluster", "environment", "replication_set", "node_id", "node_name", "az", "region", "container_name",
"cmd_type", "agent_id", "agent_type", "labels",
"fingerprint", "tables", "explain_fingerprint", "placeholders_count", "example", "example_metrics", "query_plan", "planid", "plan_summary", "is_truncated", "example_type",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
The line is 175 characters long, which exceeds the maximum of 170 characters. (lll)

Comment thread qan/models/ingestion.go
mb.Database, mb.Schema, mb.Username, mb.ClientHost,
mb.Cluster, mb.Environment, mb.ReplicationSet, mb.NodeId, mb.NodeName, mb.Az, mb.Region, mb.ContainerName,
mb.CmdType, mb.AgentId, mb.AgentType.String(), labels,
mb.Fingerprint, tables, mb.ExplainFingerprint, mb.PlaceholdersCount, mb.Example, mb.ExampleMetrics, mb.QueryPlan, mb.Planid, mb.PlanSummary, boolToUint8(mb.IsTruncated), mb.ExampleType.String(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
The line is 202 characters long, which exceeds the maximum of 170 characters. (lll)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants