Skip to content

WIP#89

Closed
jkool702 wants to merge 1 commit intoTESTING/main_newfrom
main
Closed

WIP#89
jkool702 wants to merge 1 commit intoTESTING/main_newfrom
main

Conversation

@jkool702
Copy link
Copy Markdown
Owner

@jkool702 jkool702 commented Nov 12, 2025

Summary by Sourcery

Enhance timep.bash by improving log parsing accuracy, correcting time boundary logic, and streamlining log preprocessing steps

Enhancements:

  • Enforce tab-delimited parsing and fix start-time variable reference when reading end times
  • Tighten subshell vs background-fork detection by refining wall-clock time comparisons
  • Simplify end time and CPU time conditionals by removing redundant checks and relying on direct numeric comparisons
  • Revise log preprocessing pipeline: update sed transformations, normalize timestamps for sorting, and refine file exclusion patterns

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Nov 12, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR refactors timep.bash to improve field parsing, tighten time validity checks, simplify end-time assignments, enhance sed-based log preprocessing, and refine log file filtering.

Class diagram for updated log and time processing variables

classDiagram
    class timep_LOG_NAME {
        +string[]
        +filtered: excludes init_cs, out, out.combined, raw
    }
    class logA {
        +string[]
        +preprocessed: traps integrated, sorted by NEXEC
    }
    class tStartA {
        +int[]
        +filtered: only numeric, dots removed
    }
    class tEndA {
        +int[]
        +filtered: only numeric, dots removed
    }
    timep_LOG_NAME --> logA : derived from
    logA --> tStartA : used to compute
    logA --> tEndA : used to compute
Loading

Flow diagram for improved log preprocessing and filtering

flowchart TD
    A["Raw log file (${logCur})"] --> B["Move to .raw file"]
    B --> C["Preprocess with sed (integrate traps, sort by NEXEC, enhance trap handling)"]
    C --> D["Filter with grep and sort"]
    D --> E["Load into logA"]
    E --> F["Further processing (times, nesting, etc.)"]
Loading

Flow diagram for improved end time assignment and validation

flowchart TD
    A["Read end time candidate"] --> B["Check: end time < global end time"]
    B --> C["Check: end time > start time"]
    C --> D["Assign end time if valid"]
    D --> E["Update end time array"]
Loading

File-Level Changes

Change Details Files
Fix field splitting and array reference when reading end times
  • Added IFS=$'\t' to correctly split tab-separated fields in the while loop
  • Renamed array reference from timep_START_TIME to timep_STARTTIME to match variable name
timep.bash
Tighten subshell-to-background forking detection
  • Updated conditional to use && instead of
Simplify endWTime and endCTime assignment conditions
  • Removed redundant nested bracket tests in both endWTime and endCTime blocks
  • Kept only non-'-' and > startTime checks for clearer intent
timep.bash
Enhance log preprocessing pipeline
  • Refined sed expressions to prevent extra blank lines before @trap records
  • Consolidated pattern matches for more reliable trap integration
timep.bash
Extend and normalize time collection
  • Changed printf to include both tStartA and tEndA values
  • Stripped decimal points from timestamps before sorting
timep.bash
Refine log name filtering
  • Expanded grep -vE pattern to exclude raw and combined out files
  • Ensured only relevant logs are loaded into timep_LOG_NAME
timep.bash

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jkool702 jkool702 closed this Nov 12, 2025
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.

1 participant