You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a case where I need to know the time when a tool was launched, which is done via ResolvedContext.execute_shell (eg, when you run rez-env blah -- mycommand). I would like to write this to an env-var.
The existing REZ_USED_TIMESTAMP (https://github.com/nerdvegas/rez/wiki/Environment-Variables#context-environment-variables) is similar to what I need, but not quite right. REZ_USED_TIMESTAMP is set to --timestamp if present, rather than the true time of resolve. Furthermore, it's time the context was resolved, not the time that a command was run, which can occur later (a context can be resolved once and used many times after - eg, suites).
I propose adding a new REZ_SHELL_INIT_TIMESTAMP env-var, which is set to epoch time every time a shell is created (via execute_shell).
Related - it would also be useful to set a var that indicates whether a command was run or not (ie command arg in execute_shell). The reason - I need to determine tool startup time, and if command is None, this generally means that an interactive shell was started, and I need to filter out those cases.
The text was updated successfully, but these errors were encountered:
Seems like a useful addition to me! I am a bit unsure about setting it to --timestamp if present. That seems a bit odd to return a different value depending on the parameters. As a user i would rather expect that SHELL_INIT_TIMESTAMP always reflects the shell init time and not an arbitrarily set value.
When working with the value you could check if REZ_USED_REQUESTED_TIMESTAMP is non-zero and use that or else use REZ_SHELL_INIT_TIMESTAMP rather than have REZ_SHELL_INIT_TIMESTAMP reflect two different meanings.
I have a case where I need to know the time when a tool was launched, which is done via
ResolvedContext.execute_shell
(eg, when you runrez-env blah -- mycommand
). I would like to write this to an env-var.The existing
REZ_USED_TIMESTAMP
(https://github.com/nerdvegas/rez/wiki/Environment-Variables#context-environment-variables) is similar to what I need, but not quite right. REZ_USED_TIMESTAMP is set to--timestamp
if present, rather than the true time of resolve. Furthermore, it's time the context was resolved, not the time that a command was run, which can occur later (a context can be resolved once and used many times after - eg, suites).I propose adding a new
REZ_SHELL_INIT_TIMESTAMP
env-var, which is set to epoch time every time a shell is created (viaexecute_shell
).Related - it would also be useful to set a var that indicates whether a command was run or not (ie
command
arg inexecute_shell
). The reason - I need to determine tool startup time, and if command is None, this generally means that an interactive shell was started, and I need to filter out those cases.The text was updated successfully, but these errors were encountered: