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

get_runtime_stats.sh - Improve discoverability and specification of grep patterns for common timestamp formats #71

Open
power720 opened this issue Nov 7, 2023 · 0 comments
Assignees

Comments

@power720
Copy link
Contributor

power720 commented Nov 7, 2023

Problem

The --mode timestamp option of get_runtime_stats.sh is capable of calculating runtime from dates in the following formats:

  • 2022-01-02 23:45:01
  • Sun Jan 2 23:45:01 CST 2022

This is useful for calculating runtime on SETSM jobfiles logs which uses the Sun Jan 2 23:45:01 CST 2022 format. However, the default behavior is hardcoded to the 2022-01-02 23:45:01 format and requires to user to discover and pass the commented out pattern specified in the script to parse the Sun Jan 2 23:45:01 CST 2022 format.

The Sun Jan 2 23:45:01 CST 2022 format grep from line 197:
#timestamp_grep="([A-Z][a-z]+ +[A-Z][a-z]+ +[0-9]+ +[0-9]{2}:[0-9]{2}:[0-9]{2} +[A-Z]+ +[0-9]+)" # 'date' program default format'

Requested Improvement

Add a --timestamp-format option that would assign the correct `--timestamp-grep' value for these common datetime formats.

@power720 power720 self-assigned this Nov 7, 2023
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

No branches or pull requests

1 participant