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

log: track conversion times #1241

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

log: track conversion times #1241

wants to merge 4 commits into from

Conversation

de-sh
Copy link
Contributor

@de-sh de-sh commented Mar 16, 2025

Fixes #XXXX.

Description

2025-03-16T12:02:40.748282Z TRACE main ThreadId(01) parseable::parseable::streams:738: Flushing stream (test) took: 0.000087583s
2025-03-16T12:02:40.748525Z  INFO main ThreadId(01) parseable::parseable::streams:310: Starting arrow_conversion job for stream- test
2025-03-16T12:02:40.749469Z TRACE main ThreadId(01) parseable::parseable::streams:746: Converting arrows to parquet on stream (test) took: 0.00094475s

This PR has:

  • been tested to ensure log ingestion and log query works.
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added documentation for new or modified features or behaviors.

Summary by CodeRabbit

  • Chores
    • Added performance tracking to key data processing operations with detailed timing insights.
    • Improved operation handling to ensure reliable and efficient process completion.

Copy link

coderabbitai bot commented Mar 16, 2025

Walkthrough

The changes modify the flush_and_convert method in the Stream struct (located in src/parseable/streams.rs). The method now uses the Instant type to record start times and log the duration of two key operations: flushing arrows and converting to Parquet. After both operations, trace logs report the elapsed time. The method’s return statement has been changed to always return Ok(()), decoupling it from the output of self.prepare_parquet(shutdown_signal).

Changes

File Change Summary
src/parseable/streams.rs Introduced timing measurements using Instant to log the duration for flushing arrows and converting to Parquet. Modified the return to Ok(()) instead of the output from prepare_parquet().

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant Stream

    Caller->>Stream: flush_and_convert(shutdown_signal)
    Note right of Stream: Record start time for flush
    Stream->>Stream: Execute flush arrows operation
    Note right of Stream: Log duration of flush
    Note right of Stream: Record start time for conversion
    Stream->>Stream: Execute conversion to Parquet
    Note right of Stream: Log duration of conversion
    Stream-->>Caller: Return Ok(())
Loading

Possibly related PRs

  • feat: merge finish .arrows and convert to .parquet #1200: The changes in the main PR, specifically the modifications to the flush_and_convert method in the Stream struct, are directly related to the changes in the retrieved PR, which also involves the flush_and_convert method and its handling of the conversion process in the streams.rs file.

Suggested labels

for next release

Suggested reviewers

  • nikhilsinhaparseable

Poem

Hopping through the code with glee,
I log each tick so precisely,
Flushing and converting with speed,
Tracking time for every deed,
A rabbit’s cheer in every line—
A happy code hop, simply divine!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0c953ee and 19412e3.

📒 Files selected for processing (1)
  • src/parseable/streams.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/parseable/streams.rs
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Build Default aarch64-apple-darwin
  • GitHub Check: Build Default x86_64-pc-windows-msvc
  • GitHub Check: Build Default x86_64-apple-darwin
  • GitHub Check: Build Default x86_64-unknown-linux-gnu
  • GitHub Check: Build Default aarch64-unknown-linux-gnu
  • GitHub Check: Build Kafka x86_64-unknown-linux-gnu
  • GitHub Check: Build Kafka aarch64-apple-darwin
  • GitHub Check: Quest Smoke and Load Tests for Standalone deployments
  • GitHub Check: Quest Smoke and Load Tests for Distributed deployments
  • GitHub Check: coverage

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@de-sh de-sh changed the title log: track convertion times log: track conversion times Mar 16, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 16, 2025
Signed-off-by: Devdutt Shenoi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants