diff --git a/doc/source/overview_stats.rst b/doc/source/overview_stats.rst index 04d2299e79..3043b57ece 100644 --- a/doc/source/overview_stats.rst +++ b/doc/source/overview_stats.rst @@ -19,11 +19,11 @@ the proxy log output to an hourly log file. For example, a proxy request that is made on August 4, 2010 at 12:37 gets logged in a file named 2010080412. This allows easy log rotation and easy per-hour log processing. -****************** -Account stats logs -****************** +********************************* +Account / Container DB stats logs +********************************* -Account stats logs are generated by a stats system process. +DB stats logs are generated by a stats system process. swift-account-stats-logger runs on each account server (via cron) and walks the filesystem looking for account databases. When an account database is found, the logger selects the account hash, bytes_used, container_count, and @@ -34,7 +34,8 @@ runs the account stats logger every hour. Therefore, in a cluster of ten account servers, ten csv files are produced every hour. Also, every account will have one entry for every replica in the system. On average, there will be three copies of each account in the aggregate of all account stat csv files -created in one system-wide run. +created in one system-wide run. The swift-container-stats-logger runs in a +similar fashion, scanning the container dbs. ---------------------- Log Processing plugins diff --git a/etc/log-processor.conf-sample b/etc/log-processor.conf-sample index f014168a90..350ae73010 100644 --- a/etc/log-processor.conf-sample +++ b/etc/log-processor.conf-sample @@ -54,3 +54,4 @@ processable = false # devices = /srv/node # mount_check = true # user = swift +# metadata_keys = comma separated list of user metadata keys to be collected diff --git a/swift/stats/db_stats_collector.py b/swift/stats/db_stats_collector.py index c8faa66779..e6edf47002 100644 --- a/swift/stats/db_stats_collector.py +++ b/swift/stats/db_stats_collector.py @@ -139,8 +139,10 @@ class ContainerStatsCollector(DatabaseStatsCollector): super(ContainerStatsCollector, self).__init__(stats_conf, 'container', container_server_data_dir, 'container-stats-%Y%m%d%H_') - self.metadata_keys = [mkey.strip() for mkey in - stats_conf.get('metadata_keys', '').split(',') if mkey.strip()] + # webob calls title on all the header keys + self.metadata_keys = ['X-Container-Meta-%s' % mkey.strip().title() + for mkey in stats_conf.get('metadata_keys', '').split(',') + if mkey.strip()] def get_header(self): header = 'Account Hash, Container Name, Object Count, Bytes Used'