Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ingestion performance #1135

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nikhilsinhaparseable
Copy link
Contributor

current: multiple loops throuch each event in the batch

  1. to find the level of hierarchy in the nested json
  2. flattening to convert arrays to rows
  3. app separator _ between keys for objects

change: merge all the loops into one to improve performance
add env var P_JSON_FLATTEN_DEPTH_LIMIT to limit the level of hierarchy defaults to 3
throw exception if level of hierarchy in the json exceeds the allowed limit refactor code

@coveralls
Copy link

coveralls commented Jan 24, 2025

Pull Request Test Coverage Report for Build 12981611342

Details

  • 382 of 406 (94.09%) changed or added relevant lines in 8 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.6%) to 13.377%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/cli.rs 0 1 0.0%
src/handlers/http/modal/ingest_server.rs 0 1 0.0%
src/handlers/http/modal/utils/ingest_utils.rs 0 9 0.0%
src/utils/json/flatten.rs 275 288 95.49%
Files with Coverage Reduction New Missed Lines %
src/handlers/http/modal/utils/ingest_utils.rs 1 28.26%
src/utils/json/flatten.rs 2 90.15%
src/utils/json/mod.rs 3 89.66%
Totals Coverage Status
Change from base Build 12964606893: 0.6%
Covered Lines: 2579
Relevant Lines: 19280

💛 - Coveralls

current: multiple loops throuch each event in the batch
1. to find the level of hierarchy in the nested json
2. flattening to convert arrays to rows
3. app separator `_` between keys for objects

change: merge all the loops into one to improve performance
add env var `P_JSON_FLATTEN_DEPTH_LIMIT` to limit the level of hierarchy
defaults to 3
throw exception if level of hierarchy in the json exceeds the allowed limit
refactor code
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