A function is doing IO operation . If the IO reaches a size more than warning limit storage array will send the event to host. The same function will fetch the event.
I have used the verb-noun pattern and the name of the function is as below.
"Get-SoftAlertAfterRunIO"
It is not making sense as it is not only getting, it is also generating.
Another name I can use is:
Generate-SoftAlert
But it is not an approved verb. What could be the equivalent verb for generate?
Or is there any good name to reflect the behavior of this code.
The full code is given below
function Generate-SoftAlert {
param
(
$VolumeObject,
$Size
)
$Path = $VolumeObject.Path
$IOTimeStamp = StartIO -Path $Path -LimitSizeInGB $Size
$IOStarttimeInArray = $IOTimeStamp.IOStarttimeInArray
$IOStarttimeInHost = $IOTimeStamp.IOStartTimeInHost
$IOEndtimeInArray = $IOTimeStamp.IOEndtimeInArray
$IOEndtimeInHost = $IOTimeStamp.IOendTimeInHost
$VolumeName = $VolumeObject.Name
$IsSoftAlertInArray= Test-SoftAlertInArray -VolumeName $VolumeName -FromTimeStamp $IOStarttimeInArray -ToTimestamp $IOEndtimeInArray
$DiskNumber = $VolumeObject.DiskNumber
$SoftAlert = Get-SoftAlertInHost -After $IOStarttimeInHost -Before $IOEndtimeInHost -DiskNumber $DiskNumber
$IsSoftAlert = ($SoftAlert -ne $null)
$Message = $SoftAlert.Message
$IsLogSense = $false
If($IsSoftAlert -eq $true)
{
$IsLogSense = Test-LogSenseMessage -LogMessage $Message -DiskNumber $DiskNumber -thresholdInGb $WarningLimit
}
return [pscustomobject]@{
SoftAlert = $IsSoftAlert
LogSense = $IsLogSense
SoftAlertInArray = $IsSoftAlertInArray
}
}
A function is doing IO operation and once the IO reaches a given size it will trigger the event and the function will fetch it.
What is "it" in "it will trigger the event"? What is "it" in "the function will fetch it"? \$\endgroup\$