Skip to content
Permalink
Browse files
GEODE-8181: Fixes default value for statistic-sampling-enabled. (#606)
  • Loading branch information
pivotal-jbarrett committed Jun 2, 2020
1 parent a1f9244 commit c19087dfee444d12b5509641693294129a625c6b
Showing 9 changed files with 16 additions and 14 deletions.
@@ -51,6 +51,7 @@ public override void InitTests()
{
base.InitTests();
Properties<string, string> config = new Properties<string, string>();
config.Insert("statistic-sampling-enabled", "true");
CacheHelper.InitConfig(config);
}

@@ -88,10 +88,7 @@ class APACHE_GEODE_EXPORT SystemProperties {
/**
* Whether time stats are enabled for the statistics.
*/
bool getEnableTimeStatistics() const /*timestatisticsEnabled()*/
{
return m_timestatisticsEnabled;
} /*m_timestatisticsEnabled*/
bool getEnableTimeStatistics() const { return m_timestatisticsEnabled; }

/**
* Returns the path of the private key file for SSL use.
@@ -14,7 +14,7 @@
# limitations under the License.
# All the configurable parameters.
statistic-sample-rate=700s
statistic-sampling-enabled=false
statistic-sampling-enabled=true
statistic-archive-file=stats.gfs
log-file=geode-native.log
#log-level=debug
@@ -47,6 +47,7 @@ size_t getNumOfEntries(std::shared_ptr<Region> &R1) {
void startDSandCreateCache(std::shared_ptr<Cache> &cache) {
auto pp = Properties::create();
auto cacheFactory = CacheFactory(pp);
cacheFactory.set("statistic-sampling-enabled", "true");
cache = std::make_shared<Cache>(cacheFactory.create());
ASSERT(cache != nullptr, "cache not equal to null expected");
}
@@ -109,6 +110,9 @@ BEGIN_TEST(TEST_EXPIRATION)

ASSERT(cache != nullptr, "Expected cache to be NON-nullptr");

ASSERT(cache->getSystemProperties().statisticsEnabled(),
"Statistics must be enabled for expiration.");

auto cacheImpl = CacheRegionHelper::getCacheImpl(cache.get());

size_t n;
@@ -51,7 +51,7 @@ BEGIN_TEST(DEFAULT)
ASSERT(
systemProperties->statisticsSampleInterval() == std::chrono::seconds(1),
"expected 1");
ASSERT(systemProperties->statisticsEnabled() == true, "expected true");
ASSERT(systemProperties->statisticsEnabled() == false, "expected false");
LOG(systemProperties->statisticsArchiveFile());
auto &&statisticsArchiveFileName =
systemProperties->statisticsArchiveFile();
@@ -80,7 +80,7 @@ BEGIN_TEST(NEW_CONFIG)
std::chrono::seconds(700),
"expected 700");

ASSERT(systemProperties->statisticsEnabled() == false, "expected false");
ASSERT(systemProperties->statisticsEnabled() == true, "expected true");

ASSERT(systemProperties->threadPoolSize() == 96,
"max-fe-thread should be 96");
@@ -128,10 +128,10 @@ void LocalRegion::updateAccessAndModifiedTime(bool modified) {
}
std::shared_ptr<CacheStatistics> LocalRegion::getStatistics() const {
CHECK_DESTROY_PENDING(TryReadGuard, LocalRegion::getStatistics);
bool m_statisticsEnabled = true;
auto& props = m_cacheImpl->getDistributedSystem().getSystemProperties();
m_statisticsEnabled = props.statisticsEnabled();
if (!m_statisticsEnabled) {

if (!m_cacheImpl->getDistributedSystem()
.getSystemProperties()
.statisticsEnabled()) {
throw StatisticsDisabledException(
"LocalRegion::getStatistics statistics disabled for this region");
}
@@ -88,7 +88,7 @@ constexpr auto DefaultConnectWaitTimeout = std::chrono::seconds::zero();
constexpr auto DefaultBucketWaitTimeout = std::chrono::seconds::zero();

constexpr auto DefaultSamplingInterval = std::chrono::seconds(1);
const bool DefaultSamplingEnabled = true;
constexpr bool DefaultSamplingEnabled = false;

const char DefaultStatArchive[] = "statArchive.gfs";
const char DefaultLogFilename[] = ""; // stdout...
@@ -39,7 +39,7 @@
#
# the rate is in seconds.
#statistic-sample-rate=1
#statistic-sampling-enabled=true
#statistic-sampling-enabled=false
#statistic-archive-file=statArchive.gfs
# zero indicates use no limit.
#archive-file-size-limit=0
@@ -186,7 +186,7 @@ When the chunk handler is not operative (enable-chunk-handler=false), each appli
<tr class="odd">
<td>statistic-sampling-enabled</td>
<td>Controls whether the process creates a statistic archive file.</td>
<td>true</td>
<td>false</td>
</tr>
<tr class="even">
<td>statistic-archive-file</td>

0 comments on commit c19087d

Please sign in to comment.