RFR: 81820709 - Container Awareness JEP

Bob Vandette bob.vandette at oracle.com
Thu May 24 19:31:18 UTC 2018


> On May 24, 2018, at 2:42 PM, mandy chung <mandy.chung at oracle.com> wrote:
> 
> 
> 
> On 5/23/18 7:39 AM, Bob Vandette wrote:
>>> Should this be an instance method?  like
>>> cpuacct.getLongValue("cpuacct.usage”);
> >
>> I did it this way in order to provide a centralized place to check
>> for missing subsystems.  The getLongValue method does the checking
>> for all subsystems
> 
> 137         if (subsystem == null) return 0L;
> 
> should this throw NPE?  same applies to all getXXXValue methods.
> 
> I think instance methods are appropriate since they obtain
> the stat for a given subsystem unless null subsystem can
> be passed as argument?

There will be situations where some platforms will not have all subsystems available.
I’ve documented the APIs to state that if a specific Metric is not available, the return
will be 0 (null).  This is implemented by passing the unavailable subsystem (NULL)
to the query methods. 

> 
>  73     public String Path() {
>  74         return path;
>  75     }
> 
> Just notice the method name "Path()" - should be lowercase "path()”?

Ok.

> 
>> Not sure what this is in reference to, please advise?
> 
>  51     private static final Metrics instance = initContainerSubSystems();
>  53     private static final String providerName = "cgroupv1";
> 
> INSTANCE and PROVIDER_NAME

Ok, thanks.  I’ll take care of that.

> 
>>> What does java --help-extra show?  The help message should include
>>> -XshowSettings:system only on Linux.
>> The message looks like it comes out of a resource file will need to
>> be localized. How do we make the message conditional on operating
>> system in that case? Can I just put (Linux Only) in the english
>> version and then get it localized?
> 
> The existing launcher.properties lists platform-specific options
> in text form:
> 
> The following options are Mac OS X specific:\n\
>    -XstartOnFirstThread
>    :
> 
> That's one possibility.

Yes, I saw that but wasn’t sure how new text that’s added to the launcher.properties file would get
localized.  Is there a process for getting this done?

Bob.

> 
>> Here’s the new output:
>> ./java -XshowSettings:system
> 
> Thanks for trimming the output.
> 
>> I’ll be sending out a webrev that includes the tests next week once
>> I’ve integrated them with my change and perform some testing on
>> different Linux systems and docker containers.
> 
> Sounds good.
> 
> Thanks
> Mandy



More information about the serviceability-dev mailing list