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

[Feature request] RuleRecord: Change the unit of Time to millisecond. #192

Closed
LaurentDardenne opened this issue Jun 18, 2019 · 1 comment · Fixed by #205
Closed

[Feature request] RuleRecord: Change the unit of Time to millisecond. #192

LaurentDardenne opened this issue Jun 18, 2019 · 1 comment · Fixed by #205
Labels
enhancement New feature or request
Milestone

Comments

@LaurentDardenne
Copy link

Is your feature request related to a problem? Please describe.
The unit of the Time property of the RuleRecord class should be in millisecond, because in seconds we can not know the total execution time.

$Path='C:\temp'
$File='Test.Rule.ps1'
@'
Rule Main  {
    sleep -Milliseconds 350
    $True
} 

Rule Main2  {
    sleep -Milliseconds 350
    $True
} 

Rule Main3  {
    sleep -Milliseconds 300
    $True
} 

'@ >"$Path\$File"

$r='object'|Invoke-psrule -path "$path\$File"
$r|select RuleID,Time

# RuleId              Time
# ------              ----
# Test.Rule.ps1/Main     0
# Test.Rule.ps1/Main2    0
# Test.Rule.ps1/Main3    0

$r|Measure-Object -Property Time -sum
# Count    : 3
# Average  :
# Sum      : 0
# Maximum  :
# Minimum  :
# Property : Time

The total time should be one second at least, and not the value zero.

@BernieWhite BernieWhite added the enhancement New feature or request label Jun 18, 2019
@BernieWhite
Copy link
Member

@LaurentDardenne Agree. Thanks for the effect to log all the feedback.

@BernieWhite BernieWhite added this to the v0.7.0 milestone Jun 20, 2019
BernieWhite added a commit that referenced this issue Jun 20, 2019
BernieWhite added a commit that referenced this issue Jun 21, 2019
…lliseconds #191 #192 (#205)

* Fix null DependsOn parameter #191

* Exclude VS test results

* Record rule time in milliseconds

* Add documentation on PSRule features #68

* Update change log #192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants