2 # -*- coding: utf-8 -*-
4 from __future__
import absolute_import
8 from optparse
import OptionParser
10 sys
.path
.insert(0, os
.path
.dirname(__file__
) or '.')
12 if __name__
== '__main__':
15 parser
= OptionParser()
16 parser
.add_option('--include', dest
='include_filter', type='string', action
='append', help='include only processes that match the given regex')
17 parser
.add_option('--exclude', dest
='exclude_filter', type='string', action
='append', help='exclude processes that match the given regex')
19 (options
, args
) = parser
.parse_args()
21 monitor
= bwmon
.Monitor()
22 monitor
.set_filter(options
.include_filter
, options
.exclude_filter
)