In the interests of modularity, I am thinking of developing a single script that captures data and creates Performance Log records for all scripts or other monitored processes.
I Imagine creating this script and then nesting all monitored scripts within it as subscripts. Lets call this the 'shell script' as it encapsulates the functional scripts.
I am thinking this way because the first thing I need for monitoring is a start time (Beginning) and then I need to capture the end time (finish) for any given process to see how long it takes. SO my functional scripts need to sit within a start and end of a monitoring script/s . At least that's what I think.
Not necessarily. In fact, this is pretty poor from the standpoint of modularity. One of the principles of modularity is that each function / method / procedure should be independent. The calling process should pass to that chunk of code everything it needs, and it should return the result.
Another problem with this approach is it makes it difficult to capture performance within just a portion of the script.
Should I just have my functional scripts each call 2 subscripts - one to get start values and one to get end values and build more parameter 'list' values to pass monitoring context to the two subscripts?
Yes, this is a much better approach. Another (probably better) option would be to capture start and end times in variables and then pass them to the logging script as parameters. That way, you need only to create and save the log record (instead of needing to keep track of which record in the log needs to receive the end time).
I like the 3rd idea - variables - with this approach I can just make 1 logging script and pass it the variables and any other context data I need.