~notmyname/swift/deslogging

« back to all changes in this revision

Viewing changes to bin/swift-container-stats-logger

  • Committer: Tarmac
  • Author(s): David Goetz, Jay Payne
  • Date: 2011-05-18 15:48:17 UTC
  • mfrom: (286.3.22 containerstat)
  • Revision ID: tarmac-20110518154817-n03d5aig142496q2
Adding container stats collector, unit tests, and refactoring some of the stats code.  There will have to be changes to both the swift and rackswift conf files before this can be released.  Please DO NOT approve this branch for merge until glange's stats stuff is all ready to go.  gracias.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# Copyright (c) 2010-2011 OpenStack, LLC.
 
3
#
 
4
# Licensed under the Apache License, Version 2.0 (the "License");
 
5
# you may not use this file except in compliance with the License.
 
6
# You may obtain a copy of the License at
 
7
#
 
8
#    http://www.apache.org/licenses/LICENSE-2.0
 
9
#
 
10
# Unless required by applicable law or agreed to in writing, software
 
11
# distributed under the License is distributed on an "AS IS" BASIS,
 
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 
13
# implied.
 
14
# See the License for the specific language governing permissions and
 
15
# limitations under the License.
 
16
 
 
17
from swift.stats.db_stats_collector import ContainerStatsCollector
 
18
from swift.common.utils import parse_options
 
19
from swift.common.daemon import run_daemon
 
20
 
 
21
if __name__ == '__main__':
 
22
    conf_file, options = parse_options()
 
23
    # currently ContainerStatsCollector only supports run_once
 
24
    options['once'] = True
 
25
    run_daemon(ContainerStatsCollector, conf_file,
 
26
               section_name='log-processor-container-stats',
 
27
               log_name="container-stats", **options)