Investigate without using Perl Time/HiRes.pm
- Dominant language
- Java
- Stars
- 22
- Forks
- 114
- Avg merge
- 4d 2h
- Merged PRs (30d)
- 8
Description
In [src/org/testKitGen/MkGen.java](https://github.com/adoptium/TKG/blob/58e40ba0d6563039c44f20b38adbfd4820faef7a/src/org/testKitGen/MkGen.java), perl `-MTime::HiRes` is used to get `Start Time` and `Finish Time`.
https://github.com/adoptium/TKG/blob/58e40ba0d6563039c44f20b38adbfd4820faef7a/src/org/testKitGen/MkGen.java#L129
https://github.com/adoptium/TKG/blob/58e40ba0d6563039c44f20b38adbfd4820faef7a/src/org/testKitGen/MkGen.java#L215
https://github.com/adoptium/TKG/blob/58e40ba0d6563039c44f20b38adbfd4820faef7a/src/org/testKitGen/MkGen.java#L231
https://github.com/adoptium/TKG/blob/58e40ba0d6563039c44f20b38adbfd4820faef7a/src/org/testKitGen/MkGen.java#L241
The time is further processed to get the test execution time.
https://github.com/adoptium/TKG/blob/58e40ba0d6563039c44f20b38adbfd4820faef7a/scripts/resultsSum.pl#L141-L149
Normal output:
```
floatSanityTests_1 Start Time: Thu Jul 17 00:27:28 2025 Epoch Time (ms): 1752708448401
...
cache cleanup done
floatSanityTests_1 Finish Time: Thu Jul 17 00:27:31 2025 Epoch Time (ms): 1752708451369
```
If the machine does not have the Perl module installed, we will get output
```
Can't locate Time/HiRes.pm in @INC (you may need to install the Time::HiRes module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5).
BEGIN failed--compilation aborted.
...
cache cleanup done
Can't locate Time/HiRes.pm in @INC (you may need to install the Time::HiRes module) (@INC contains: /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5).
BEGIN failed--compilation aborted.
```
It seems that the above are the only 4 places Perl is used in MkGen.java. Instead of using Perl Time/HiRes.pm, we should investigate using a common shell command that works on all platforms. If we can do it, we can remove the dependency on Perl Time/HiRes.pm.
For example:
```
epoch_millis=$(( $(date -u +%s) * 1000 )); echo "$epoch_millis"
```
Or just print `$(date)` in MkGen.java, and do conversion and calculation in resultsSum.pl.
Contributor guide
Research direction
Start with the four Perl Time::HiRes uses in src/org/testKitGen/MkGen.java, then inspect the time parsing and execution-time calculation at scripts/resultsSum.pl lines 141-149. Compare the proposed shell date output approaches and verify that Start Time, Finish Time, and calculated test execution time remain compatible without the Perl module.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, perl, shell
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100