Changeset 198 for trunk/daemon


Ignore:
Timestamp:
09/21/05 16:29:10 (19 years ago)
Author:
bastiaans
Message:

daemon/jobarchived.py:

  • Now with support for ARCHIVE_EXCLUDE_METRICS ! List of metric names (string or regexp) not to archive
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/jobarchived.py

    r196 r198  
    1313import threading
    1414import random
     15import re
    1516from types import *
    1617import DBClass
     
    7172#
    7273ARCHIVE_HOURS_PER_RRD = 12
     74
     75# Which metrics to exclude from archiving
     76# NOTE: This can be a regexp or a string
     77#
     78ARCHIVE_EXCLUDE_METRICS = [ "^Temp_.*_.*", ".*_Temp_.*", ".*_RPM_.*", ".*_Battery_.*" ]
    7379
    7480# Toga's SQL dbase to use
     
    645651
    646652                        type = attrs.get( 'TYPE', "" )
    647 
    648                         if type not in UNSUPPORTED_ARCHIVE_TYPES:
     653                       
     654                        exclude_metric = False
     655                       
     656                        for ex_metricstr in ARCHIVE_EXCLUDE_METRICS:
     657
     658                                orig_name = attrs.get( 'NAME', "" )     
     659
     660                                if string.lower( orig_name ) == string.lower( ex_metricstr ):
     661                               
     662                                        exclude_metric = True
     663
     664                                elif re.match( ex_metricstr, orig_name ):
     665
     666                                        exclude_metric = True
     667
     668                        if type not in UNSUPPORTED_ARCHIVE_TYPES and not exclude_metric:
    649669
    650670                                myMetric = { }
Note: See TracChangeset for help on using the changeset viewer.