Skip to content

Conversation

@BupycHuk
Copy link
Contributor

PMM-14555 PMM-14562

Link to the Feature Build: SUBMODULES-0

If this PR adds, removes or alters one or more API endpoints, please review and add or update the relevant API documentation as well:

  • API Docs updated

If this PR is related to some other PRs in this or other repositories, please provide links to those PRs:

  • Links to related pull requests (optional).

…eal-time query data

- Added new gRPC method `GetRealtimeQueryData` to the `RealtimeAnalyticsService` for retrieving real-time query data.
- Introduced `QueryDataItem`, `GetRealtimeQueryDataRequest`, and `GetRealtimeQueryDataResponse` message types to support the new API.
- Implemented request handling and validation for the new API in the service layer.
- Updated documentation to reflect the new functionality and its usage.
…tics testing

- Added a new `MockGenerator` to generate mock query data for testing purposes.
- Integrated the mock generator into the gRPC server startup process.
- The mock generator runs in a separate goroutine and generates random queries for RTA-enabled services.
- This addition is intended for testing and should be configurable or removed in production.
@BupycHuk BupycHuk requested a review from a team as a code owner December 22, 2025 10:11
@BupycHuk BupycHuk requested review from JiriCtvrtka and maxkondr and removed request for a team December 22, 2025 10:11
@codecov
Copy link

codecov bot commented Dec 22, 2025

Codecov Report

❌ Patch coverage is 19.04762% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.04%. Comparing base (47449f3) to head (4cb230c).

Files with missing lines Patch % Lines
managed/services/realtimeanalytics/generator.go 0.00% 82 Missing ⚠️
managed/cmd/pmm-managed/main.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##           PMM-14554-rta-in-memory-store    #4864      +/-   ##
=================================================================
- Coverage                          46.11%   46.04%   -0.07%     
=================================================================
  Files                                366      367       +1     
  Lines                              38082    38187     +105     
=================================================================
+ Hits                               17560    17582      +22     
- Misses                             18836    18920      +84     
+ Partials                            1686     1685       -1     
Flag Coverage Δ
admin 17.82% <ø> (ø)
agent 53.40% <ø> (ø)
managed 46.77% <19.04%> (-0.11%) ⬇️
vmproxy 72.09% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

BupycHuk and others added 8 commits December 22, 2025 11:16
…used cluster filter parameter in query retrieval, streamlining data fetching from the store.
…nerating mock query data. The generator runs in the background and produces data for RTA-enabled services, enhancing testing capabilities. This change includes the addition of a new generator file and updates to the main.go file to utilize the new generator.
…. Added validation logic to ensure ServiceIds field is populated, enhancing data integrity for real-time query requests.
go rtaStore.Run(ctx)

// Start generator for testing (TODO: remove in production or make configurable)
gen := realtimeanalytics.NewGenerator(rtaStore, deps.db)
Copy link
Member

Choose a reason for hiding this comment

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

We can put it behind a PMM_DEV_ envvar.

…d on the PMM_DEV_RTA_GENERATOR_ENABLED environment variable, improving configurability for development and testing environments.
…ement TestGetRealtimeQueryData in service_test.go

- Updated AGENT.md to include instructions for running make targets inside the Docker development container, ensuring consistent tooling versions and permissions.
- Added TestGetRealtimeQueryData to service_test.go, implementing comprehensive tests for the GetRealtimeQueryData method, including scenarios for empty results, single service data retrieval, multiple services, and filtering non-requested services.
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.

4 participants