Odg: Odg: disable statistic archival

2020-01-23 Thread Mario Kevo
Hi Kirk,

In DistributionConfig we have setStatisticArchiveFile() which is implemented in 
DistributionConfigImpl  and RuntimeDistributionConfigImpl. There you can see 
when it read properties from properties file if statistic-archive-file is null 
then it writes an empty file:

public void setStatisticArchiveFile(File value) {
   if (value == null) {
value = new File("");
  }
  statisticArchiveFile = value;
}

But in the case we change it from gfsh with alter runtime command it go through 
all parameters(which can be changed by this command) and check if it is 
different than null, in the case it is different than null and not empty it 
updates properties file. If we set --statistic-archive-file="" it will see that 
it is empty and then we got "Please provide a relevant parameter(s)" as it 
reads like it has no parameters.

BR,
Mario

Šalje: Kirk Lund 
Poslano: 23. siječnja 2020. 18:55
Prima: geode 
Predmet: Re: Odg: disable statistic archival

I hadn't thought of this usage before, but it makes sense. If you want
stats showing up on MBeans and/or in Micrometer, then setting
--statistic-archive-file="" is probably the correct way to do it. It's
possible that ServerLauncher or something deeper is
setting --statistic-archive-file to a non-empty value if it's empty. I
think you probably need to find that code and then review it to see how it
needs to change. If you find it, point me at it and I'll help review it.

On Wed, Jan 22, 2020 at 11:36 PM Mario Kevo  wrote:

> @Kirk<mailto:kl...@apache.org>, in case we change --enable-statistic(this
> flag refer to STATISTIC_SAMPLING_ENABLED ) to false we lose some metrics in
> gfsh and pulse.
> What if we want to keep statistic on, but not archive it to file.
> I don't see now how to disable archiving statistics to file, but keep
> statistics in gfsh and pulse.
>
> Yes, the user guide could be clearer.
>
>
> 
> Šalje: Kirk Lund 
> Poslano: 22. siječnja 2020. 20:44
> Prima: geode 
> Predmet: Re: disable statistic archival
>
> Dave, In your list, I think "enable-statistics" should be
> "enable-time-statistics". But, yes you're right!
>
> On Wed, Jan 22, 2020 at 9:46 AM Dave Barnes  wrote:
>
> > I'm getting the impression that the user guide could be clearer with
> regard
> > to the interactions between
> >
> >- enable-statistics
> >- statistic-sampling-enabled
> >- statistic-archive-file
> >
> >
> >
> > On Wed, Jan 22, 2020 at 9:30 AM Kirk Lund  wrote:
> >
> > > Try setting STATISTIC_SAMPLING_ENABLED to false to disable statistic
> > > sampling.
> > >
> > > I think we should delete "An empty string (default) disables statistic
> > > archival." from the javadocs for STATISTIC_ARCHIVE_FILE to avoid
> > confusion
> > > and redundancy with STATISTIC_SAMPLING_ENABLED.
> > >
> > > See below for the javadocs on both properties.
> > >
> > >   /**
> > >* The static String definition of the
> "statistic-archive-file"
> > > property  > >* name="statistic-archive-file"/a>
> > >* 
> > >* Description: The file that statistic samples are written
> to.
> > An
> > > empty string (default)
> > >* disables statistic archival.
> > >* 
> > >* Default: ""
> > >*/
> > >   String STATISTIC_ARCHIVE_FILE = "statistic-archive-file";
> > >
> > >   /**
> > >* The static String definition of the
> > > "statistic-sampling-enabled" property  > >* name="statistic-sampling-enabled"/a>
> > >* 
> > >* Description: "true" causes the statistics to be sampled
> > > periodically and operating
> > >* system statistics to be fetched each time a sample is taken.
> "false"
> > > disables sampling which
> > >* also disables operating system statistic collection. Non OS
> > statistics
> > > will still be recorded
> > >* in memory and can be viewed by administration tools. However,
> charts
> > > will show no activity and
> > >* no statistics will be archived while sampling is disabled.
> Starting
> > in
> > > 7.0 the default value
> > >* has been changed to true. If statistic sampling is disabled it
> will
> > > also cause various metrics
> > >* seen in gfsh and pulse to always be zero.
> > >* 
> > >* Default: "true"
> > >* 
> > 

Re: Odg: disable statistic archival

2020-01-23 Thread Kirk Lund
I hadn't thought of this usage before, but it makes sense. If you want
stats showing up on MBeans and/or in Micrometer, then setting
--statistic-archive-file="" is probably the correct way to do it. It's
possible that ServerLauncher or something deeper is
setting --statistic-archive-file to a non-empty value if it's empty. I
think you probably need to find that code and then review it to see how it
needs to change. If you find it, point me at it and I'll help review it.

On Wed, Jan 22, 2020 at 11:36 PM Mario Kevo  wrote:

> @Kirk, in case we change --enable-statistic(this
> flag refer to STATISTIC_SAMPLING_ENABLED ) to false we lose some metrics in
> gfsh and pulse.
> What if we want to keep statistic on, but not archive it to file.
> I don't see now how to disable archiving statistics to file, but keep
> statistics in gfsh and pulse.
>
> Yes, the user guide could be clearer.
>
>
> 
> Šalje: Kirk Lund 
> Poslano: 22. siječnja 2020. 20:44
> Prima: geode 
> Predmet: Re: disable statistic archival
>
> Dave, In your list, I think "enable-statistics" should be
> "enable-time-statistics". But, yes you're right!
>
> On Wed, Jan 22, 2020 at 9:46 AM Dave Barnes  wrote:
>
> > I'm getting the impression that the user guide could be clearer with
> regard
> > to the interactions between
> >
> >- enable-statistics
> >- statistic-sampling-enabled
> >- statistic-archive-file
> >
> >
> >
> > On Wed, Jan 22, 2020 at 9:30 AM Kirk Lund  wrote:
> >
> > > Try setting STATISTIC_SAMPLING_ENABLED to false to disable statistic
> > > sampling.
> > >
> > > I think we should delete "An empty string (default) disables statistic
> > > archival." from the javadocs for STATISTIC_ARCHIVE_FILE to avoid
> > confusion
> > > and redundancy with STATISTIC_SAMPLING_ENABLED.
> > >
> > > See below for the javadocs on both properties.
> > >
> > >   /**
> > >* The static String definition of the
> "statistic-archive-file"
> > > property  > >* name="statistic-archive-file"/a>
> > >* 
> > >* Description: The file that statistic samples are written
> to.
> > An
> > > empty string (default)
> > >* disables statistic archival.
> > >* 
> > >* Default: ""
> > >*/
> > >   String STATISTIC_ARCHIVE_FILE = "statistic-archive-file";
> > >
> > >   /**
> > >* The static String definition of the
> > > "statistic-sampling-enabled" property  > >* name="statistic-sampling-enabled"/a>
> > >* 
> > >* Description: "true" causes the statistics to be sampled
> > > periodically and operating
> > >* system statistics to be fetched each time a sample is taken.
> "false"
> > > disables sampling which
> > >* also disables operating system statistic collection. Non OS
> > statistics
> > > will still be recorded
> > >* in memory and can be viewed by administration tools. However,
> charts
> > > will show no activity and
> > >* no statistics will be archived while sampling is disabled.
> Starting
> > in
> > > 7.0 the default value
> > >* has been changed to true. If statistic sampling is disabled it
> will
> > > also cause various metrics
> > >* seen in gfsh and pulse to always be zero.
> > >* 
> > >* Default: "true"
> > >* 
> > >* Allowed values: true|false
> > >*/
> > >   String STATISTIC_SAMPLING_ENABLED = "statistic-sampling-enabled";
> > >
> > > On Tue, Jan 21, 2020 at 1:06 AM Mario Kevo 
> wrote:
> > >
> > > > Hi,
> > > >
> > > > We are trying to disable archiving statistic in the file by providing
> > > > empty string to --statistic-archive-file. This option doesn't work.
> > > > From the documentation it should work:
> > > > The file to which the running system member writes statistic samples.
> > For
> > > > example: “StatisticsArchiveFile.gfs”. An empty string disables
> > archiving.
> > > > I opened ticket(GEODE-7714<
> > > > https://issues.apache.org/jira/browse/GEODE-7714>) and try to fix
> it,
> > > but
> > > > without success.
> > > >
> > > > As alter runtime command update properties and cache, it checks if
> any
> > of
> > > > these parameters change, but if we set this property to an empty
> string
> > > it
> > > > failed with message
> > > > Please provide a relevant parameter(s).
> > > > We can change for this parameter that it can be an empty string but
> how
> > > > this command works, it goes over all parameters and checks if it is
> > > > changed. In that case if we provide something like
> > > > alter runtime --member=server it will be successiful but shouldn't as
> > we
> > > > didn't provide any parameter.
> > > >
> > > > So the proposal is that we need to add a new parameter called
> > > > --statistic-archiving-enabled  which can be true or false. In case it
> > is
> > > > true we need to provide also --statistic-archive-file.
> > > >
> > > > Any thougths?
> > > >
> > > > BR,
> > > > Mario
> > > >
> > > >
> > >
> >
>


Odg: Odg: disable statistic archival

2020-01-23 Thread Mario Kevo
Yes, it works with redirecting to /dev/null.
Do we need to document to use this to disable file, or just use this as a 
workaround and continue with adding new flag?


Šalje: Owen Nichols 
Poslano: 23. siječnja 2020. 8:49
Prima: dev@geode.apache.org 
Predmet: Re: Odg: disable statistic archival

Would it work to archive them to file /dev/null

On Wed, Jan 22, 2020 at 11:36 PM Mario Kevo  wrote:

> @Kirk<mailto:kl...@apache.org>, in case we change --enable-statistic(this
> flag refer to STATISTIC_SAMPLING_ENABLED ) to false we lose some metrics in
> gfsh and pulse.
> What if we want to keep statistic on, but not archive it to file.
> I don't see now how to disable archiving statistics to file, but keep
> statistics in gfsh and pulse.
>
> Yes, the user guide could be clearer.
>
>
> 
> Šalje: Kirk Lund 
> Poslano: 22. siječnja 2020. 20:44
> Prima: geode 
> Predmet: Re: disable statistic archival
>
> Dave, In your list, I think "enable-statistics" should be
> "enable-time-statistics". But, yes you're right!
>
> On Wed, Jan 22, 2020 at 9:46 AM Dave Barnes  wrote:
>
> > I'm getting the impression that the user guide could be clearer with
> regard
> > to the interactions between
> >
> >- enable-statistics
> >- statistic-sampling-enabled
> >- statistic-archive-file
> >
> >
> >
> > On Wed, Jan 22, 2020 at 9:30 AM Kirk Lund  wrote:
> >
> > > Try setting STATISTIC_SAMPLING_ENABLED to false to disable statistic
> > > sampling.
> > >
> > > I think we should delete "An empty string (default) disables statistic
> > > archival." from the javadocs for STATISTIC_ARCHIVE_FILE to avoid
> > confusion
> > > and redundancy with STATISTIC_SAMPLING_ENABLED.
> > >
> > > See below for the javadocs on both properties.
> > >
> > >   /**
> > >* The static String definition of the
> "statistic-archive-file"
> > > property  > >* name="statistic-archive-file"/a>
> > >* 
> > >* Description: The file that statistic samples are written
> to.
> > An
> > > empty string (default)
> > >* disables statistic archival.
> > >* 
> > >* Default: ""
> > >*/
> > >   String STATISTIC_ARCHIVE_FILE = "statistic-archive-file";
> > >
> > >   /**
> > >* The static String definition of the
> > > "statistic-sampling-enabled" property  > >* name="statistic-sampling-enabled"/a>
> > >* 
> > >* Description: "true" causes the statistics to be sampled
> > > periodically and operating
> > >* system statistics to be fetched each time a sample is taken.
> "false"
> > > disables sampling which
> > >* also disables operating system statistic collection. Non OS
> > statistics
> > > will still be recorded
> > >* in memory and can be viewed by administration tools. However,
> charts
> > > will show no activity and
> > >* no statistics will be archived while sampling is disabled.
> Starting
> > in
> > > 7.0 the default value
> > >* has been changed to true. If statistic sampling is disabled it
> will
> > > also cause various metrics
> > >* seen in gfsh and pulse to always be zero.
> > >* 
> > >* Default: "true"
> > >* 
> > >* Allowed values: true|false
> > >*/
> > >   String STATISTIC_SAMPLING_ENABLED = "statistic-sampling-enabled";
> > >
> > > On Tue, Jan 21, 2020 at 1:06 AM Mario Kevo 
> wrote:
> > >
> > > > Hi,
> > > >
> > > > We are trying to disable archiving statistic in the file by providing
> > > > empty string to --statistic-archive-file. This option doesn't work.
> > > > From the documentation it should work:
> > > > The file to which the running system member writes statistic samples.
> > For
> > > > example: “StatisticsArchiveFile.gfs”. An empty string disables
> > archiving.
> > > > I opened ticket(GEODE-7714<
> > > > https://issues.apache.org/jira/browse/GEODE-7714>) and try to fix
> it,
> > > but
> > > > without success.
> > > >
> > > > As alter runtime command update properties and cache, it checks if
> any
> > of
> > > > these parameters change, but if we set this property to an empty
> string
> > > it
> > > > failed with message
> > > > Please provide a relevant parameter(s).
> > > > We can change for this parameter that it can be an empty string but
> how
> > > > this command works, it goes over all parameters and checks if it is
> > > > changed. In that case if we provide something like
> > > > alter runtime --member=server it will be successiful but shouldn't as
> > we
> > > > didn't provide any parameter.
> > > >
> > > > So the proposal is that we need to add a new parameter called
> > > > --statistic-archiving-enabled  which can be true or false. In case it
> > is
> > > > true we need to provide also --statistic-archive-file.
> > > >
> > > > Any thougths?
> > > >
> > > > BR,
> > > > Mario
> > > >
> > > >
> > >
> >
>


Re: Odg: disable statistic archival

2020-01-22 Thread Owen Nichols
Would it work to archive them to file /dev/null

On Wed, Jan 22, 2020 at 11:36 PM Mario Kevo  wrote:

> @Kirk, in case we change --enable-statistic(this
> flag refer to STATISTIC_SAMPLING_ENABLED ) to false we lose some metrics in
> gfsh and pulse.
> What if we want to keep statistic on, but not archive it to file.
> I don't see now how to disable archiving statistics to file, but keep
> statistics in gfsh and pulse.
>
> Yes, the user guide could be clearer.
>
>
> 
> Šalje: Kirk Lund 
> Poslano: 22. siječnja 2020. 20:44
> Prima: geode 
> Predmet: Re: disable statistic archival
>
> Dave, In your list, I think "enable-statistics" should be
> "enable-time-statistics". But, yes you're right!
>
> On Wed, Jan 22, 2020 at 9:46 AM Dave Barnes  wrote:
>
> > I'm getting the impression that the user guide could be clearer with
> regard
> > to the interactions between
> >
> >- enable-statistics
> >- statistic-sampling-enabled
> >- statistic-archive-file
> >
> >
> >
> > On Wed, Jan 22, 2020 at 9:30 AM Kirk Lund  wrote:
> >
> > > Try setting STATISTIC_SAMPLING_ENABLED to false to disable statistic
> > > sampling.
> > >
> > > I think we should delete "An empty string (default) disables statistic
> > > archival." from the javadocs for STATISTIC_ARCHIVE_FILE to avoid
> > confusion
> > > and redundancy with STATISTIC_SAMPLING_ENABLED.
> > >
> > > See below for the javadocs on both properties.
> > >
> > >   /**
> > >* The static String definition of the
> "statistic-archive-file"
> > > property  > >* name="statistic-archive-file"/a>
> > >* 
> > >* Description: The file that statistic samples are written
> to.
> > An
> > > empty string (default)
> > >* disables statistic archival.
> > >* 
> > >* Default: ""
> > >*/
> > >   String STATISTIC_ARCHIVE_FILE = "statistic-archive-file";
> > >
> > >   /**
> > >* The static String definition of the
> > > "statistic-sampling-enabled" property  > >* name="statistic-sampling-enabled"/a>
> > >* 
> > >* Description: "true" causes the statistics to be sampled
> > > periodically and operating
> > >* system statistics to be fetched each time a sample is taken.
> "false"
> > > disables sampling which
> > >* also disables operating system statistic collection. Non OS
> > statistics
> > > will still be recorded
> > >* in memory and can be viewed by administration tools. However,
> charts
> > > will show no activity and
> > >* no statistics will be archived while sampling is disabled.
> Starting
> > in
> > > 7.0 the default value
> > >* has been changed to true. If statistic sampling is disabled it
> will
> > > also cause various metrics
> > >* seen in gfsh and pulse to always be zero.
> > >* 
> > >* Default: "true"
> > >* 
> > >* Allowed values: true|false
> > >*/
> > >   String STATISTIC_SAMPLING_ENABLED = "statistic-sampling-enabled";
> > >
> > > On Tue, Jan 21, 2020 at 1:06 AM Mario Kevo 
> wrote:
> > >
> > > > Hi,
> > > >
> > > > We are trying to disable archiving statistic in the file by providing
> > > > empty string to --statistic-archive-file. This option doesn't work.
> > > > From the documentation it should work:
> > > > The file to which the running system member writes statistic samples.
> > For
> > > > example: “StatisticsArchiveFile.gfs”. An empty string disables
> > archiving.
> > > > I opened ticket(GEODE-7714<
> > > > https://issues.apache.org/jira/browse/GEODE-7714>) and try to fix
> it,
> > > but
> > > > without success.
> > > >
> > > > As alter runtime command update properties and cache, it checks if
> any
> > of
> > > > these parameters change, but if we set this property to an empty
> string
> > > it
> > > > failed with message
> > > > Please provide a relevant parameter(s).
> > > > We can change for this parameter that it can be an empty string but
> how
> > > > this command works, it goes over all parameters and checks if it is
> > > > changed. In that case if we provide something like
> > > > alter runtime --member=server it will be successiful but shouldn't as
> > we
> > > > didn't provide any parameter.
> > > >
> > > > So the proposal is that we need to add a new parameter called
> > > > --statistic-archiving-enabled  which can be true or false. In case it
> > is
> > > > true we need to provide also --statistic-archive-file.
> > > >
> > > > Any thougths?
> > > >
> > > > BR,
> > > > Mario
> > > >
> > > >
> > >
> >
>


Odg: disable statistic archival

2020-01-22 Thread Mario Kevo
@Kirk, in case we change --enable-statistic(this flag 
refer to STATISTIC_SAMPLING_ENABLED ) to false we lose some metrics in gfsh and 
pulse.
What if we want to keep statistic on, but not archive it to file.
I don't see now how to disable archiving statistics to file, but keep 
statistics in gfsh and pulse.

Yes, the user guide could be clearer.



Šalje: Kirk Lund 
Poslano: 22. siječnja 2020. 20:44
Prima: geode 
Predmet: Re: disable statistic archival

Dave, In your list, I think "enable-statistics" should be
"enable-time-statistics". But, yes you're right!

On Wed, Jan 22, 2020 at 9:46 AM Dave Barnes  wrote:

> I'm getting the impression that the user guide could be clearer with regard
> to the interactions between
>
>- enable-statistics
>- statistic-sampling-enabled
>- statistic-archive-file
>
>
>
> On Wed, Jan 22, 2020 at 9:30 AM Kirk Lund  wrote:
>
> > Try setting STATISTIC_SAMPLING_ENABLED to false to disable statistic
> > sampling.
> >
> > I think we should delete "An empty string (default) disables statistic
> > archival." from the javadocs for STATISTIC_ARCHIVE_FILE to avoid
> confusion
> > and redundancy with STATISTIC_SAMPLING_ENABLED.
> >
> > See below for the javadocs on both properties.
> >
> >   /**
> >* The static String definition of the "statistic-archive-file"
> > property  >* name="statistic-archive-file"/a>
> >* 
> >* Description: The file that statistic samples are written to.
> An
> > empty string (default)
> >* disables statistic archival.
> >* 
> >* Default: ""
> >*/
> >   String STATISTIC_ARCHIVE_FILE = "statistic-archive-file";
> >
> >   /**
> >* The static String definition of the
> > "statistic-sampling-enabled" property  >* name="statistic-sampling-enabled"/a>
> >* 
> >* Description: "true" causes the statistics to be sampled
> > periodically and operating
> >* system statistics to be fetched each time a sample is taken. "false"
> > disables sampling which
> >* also disables operating system statistic collection. Non OS
> statistics
> > will still be recorded
> >* in memory and can be viewed by administration tools. However, charts
> > will show no activity and
> >* no statistics will be archived while sampling is disabled. Starting
> in
> > 7.0 the default value
> >* has been changed to true. If statistic sampling is disabled it will
> > also cause various metrics
> >* seen in gfsh and pulse to always be zero.
> >* 
> >* Default: "true"
> >* 
> >* Allowed values: true|false
> >*/
> >   String STATISTIC_SAMPLING_ENABLED = "statistic-sampling-enabled";
> >
> > On Tue, Jan 21, 2020 at 1:06 AM Mario Kevo  wrote:
> >
> > > Hi,
> > >
> > > We are trying to disable archiving statistic in the file by providing
> > > empty string to --statistic-archive-file. This option doesn't work.
> > > From the documentation it should work:
> > > The file to which the running system member writes statistic samples.
> For
> > > example: “StatisticsArchiveFile.gfs”. An empty string disables
> archiving.
> > > I opened ticket(GEODE-7714<
> > > https://issues.apache.org/jira/browse/GEODE-7714>) and try to fix it,
> > but
> > > without success.
> > >
> > > As alter runtime command update properties and cache, it checks if any
> of
> > > these parameters change, but if we set this property to an empty string
> > it
> > > failed with message
> > > Please provide a relevant parameter(s).
> > > We can change for this parameter that it can be an empty string but how
> > > this command works, it goes over all parameters and checks if it is
> > > changed. In that case if we provide something like
> > > alter runtime --member=server it will be successiful but shouldn't as
> we
> > > didn't provide any parameter.
> > >
> > > So the proposal is that we need to add a new parameter called
> > > --statistic-archiving-enabled  which can be true or false. In case it
> is
> > > true we need to provide also --statistic-archive-file.
> > >
> > > Any thougths?
> > >
> > > BR,
> > > Mario
> > >
> > >
> >
>