init.cpp raw

   1  // Copyright (c) 2016 The Limenka developers
   2  // Distributed under the MIT software license, see the accompanying
   3  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
   4  
   5  #include <stats/stats.h>
   6  
   7  #include <common/args.h>
   8  #include <tinyformat.h>
   9  
  10  void CStats::AddStatsOptions()
  11  {
  12      // FIXME: autodetect which default is in use
  13      // FIXME: ensure we get the correct for multiprocess builds
  14      gArgs.AddArg("-statsenable", "Enable statistics (default: 1 for GUI, 0 otherwise)", ArgsManager::ALLOW_ANY, OptionsCategory::STATS);
  15      gArgs.AddArg("-statsmaxmemorytarget=<n>", strprintf("Set the memory limit target for statistics in bytes (default: %u)", DEFAULT_MAX_STATS_MEMORY), ArgsManager::ALLOW_ANY, OptionsCategory::STATS);
  16  }
  17  
  18  bool CStats::parameterInteraction()
  19  {
  20      if (gArgs.GetBoolArg("-statsenable", DEFAULT_STATISTICS_ENABLED))
  21          DefaultStats()->setMaxMemoryUsageTarget(gArgs.GetIntArg("-statsmaxmemorytarget", DEFAULT_MAX_STATS_MEMORY));
  22  
  23      return true;
  24  }
  25