Pārlūkot izejas kodu

[desktop] Add config options to config files

Erick Tryzelaar 10 gadi atpakaļ
vecāks
revīzija
4363f0a70f

+ 13 - 0
desktop/conf.dist/hue.ini

@@ -483,6 +483,19 @@
     # The Authorize URL
     ## authenticate_url=https://api.twitter.com/oauth/authorize
 
+  # Configuration options for Metrics
+  # ------------------------------------------------------------------------
+  [[metrics]]
+
+   # Enable the metrics URL "/desktop/metrics"
+   ## enable_web_metrics=True
+
+   # If specified, Hue will write metrics to this file.
+   ## location=/var/log/hue/metrics.json
+
+   # Time in milliseconds on how frequently to collect metrics
+   ## collection_interval=30000
+
 
 ###########################################################################
 # Settings to configure SAML

+ 13 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -492,6 +492,19 @@
     # The Authorize URL
     ## authenticate_url=https://api.twitter.com/oauth/authorize
 
+  # Configuration options for Metrics
+  # ------------------------------------------------------------------------
+  [[metrics]]
+
+   # Enable the metrics URL "/desktop/metrics"
+   ## enable_web_metrics=True
+
+   # If specified, Hue will write metrics to this file.
+   ## location=/var/log/hue/metrics.json
+
+   # Time in milliseconds on how frequently to collect metrics
+   ## collection_interval=30000
+
 
 ###########################################################################
 # Settings to configure SAML

+ 5 - 4
desktop/core/src/desktop/conf.py

@@ -356,18 +356,19 @@ METRICS = ConfigSection(
   help=_("""Configuration options for metrics"""),
   members=dict(
     ENABLE_WEB_METRICS=Config(
-      key='web_metrics',
-      help=_('Enable metrics url'),
+      key='enable_web_metrics',
+      help=_('Enable metrics URL "desktop/metrics"'),
       default=True,
       type=coerce_bool),
     LOCATION=Config(
       key='location',
-      help=_('Write metrics to this location'),
+      help=_('If specified, Hue will write metrics to this file'),
       type=str),
     COLLECTION_INTERVAL=Config(
       key='collection_interval',
       help=_('Time in milliseconds on how frequently to collect metrics'),
-      type=int),
+      type=int,
+      default=30000),
   )
 )