Menu

#131 New Default Environment Variable 'WRAPPER_OS_UPTIME'

Next_Release
open
nobody
5
2012-12-11
2011-11-15
charly
No

currently there is IMHO no means in java to access/inquire the uptime of the operating system. It would be useful to have this information i.e. to decide if the wrapper is started because of a system boot. The environment variable could provide the startup time in seconds and can be used in specifying a custom (java) system property.
I think the system uptime could be easy determined in the native wrapper code for every OS.

Integrating a method in the wrapper java API would be also a solution, but this requires the use of this API.

Please add a such Variable. Thank you.

Discussion

  • Christian Mueller

    Hello Charly,

    thank you for your post.
    I can understand that this would be helpful.
    I'm just wondering on the implementation of this.

    As environment variable, the value would change every second.
    Therefore, i would think it makes more sense to poll it on request through our API.

    cheers,
    Christian

     
  • charly

    charly - 2011-11-15

    Hello Christian,

    there is no need for having a dynamically variable or function. For me its only required to get the uptime at the moment when the JVM is started. Later the current uptime could be easily determined everytime by adding "JVM uptime" (which is available) and OS uptime (at JVM startup).
    But thinking about it again, it would be useful if ''WRAPPER_OS_UPTIME' would provide 2 values (separated by comma or underscore). The first value provides the OS uptime at the moment, when the wrapper executable was started. The second value would be evaluated, when the current JVM was (re-)started.
    I would prefer not to use the API because I want to avoid the dependence.

    Regards Charly

     
  • Christian Mueller

    hello charly,

    I was also thinking about something like that.
    Would it also be ok to have 2 variables:
    -WRAPPER_LAUNCH_UPTIME this would contain the uptime from the time the Wrapper was launched
    -WRAPPER_JVM_LAUNCH_UPTIME this would then contain the uptime from the time the Wrapper launched the current JVM

    cheers,
    christian

     
  • charly

    charly - 2011-11-16

    Hello Christian,

    yes of course 2 variables are also ok. They are indeed more flexible and can combined in wrapper.conf if considered to be useful.

    Regards Charly

     

Log in to post a comment.