def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) # parse arguments further to get --bucketsize argument argparser = argparse.ArgumentParser("mplotqueries --type histogram") argparser.add_argument('--bucketsize', '-b', action='store', metavar='SIZE', help="histogram bucket size in seconds", default=60) sub_args = vars(argparser.parse_args(unknown_args)) self.logscale = args['logscale'] # get bucket size, either as int (seconds) or as string # (see timeunits above) bs = sub_args['bucketsize'] try: self.bucketsize = int(bs) except ValueError: self.bucketsize = self.timeunits[bs] self.ylabel = "# connections opened/closed" self.group_by = opened_closed
def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) # parse arguments further to get --bucketsize argument argparser = argparse.ArgumentParser("mplotqueries --type histogram") argparser.add_argument('--bucketsize', '-b', action='store', metavar='SIZE', help="histogram bucket size in seconds", default=60) argparser.add_argument( '--no-stacked', action='store_true', help= "switch graph mode from stacked histogram (default) to side-by-side histograms.", default=False) sub_args = vars(argparser.parse_args(unknown_args)) self.logscale = args['logscale'] # get bucket size, either as int (seconds) or as string (see timeunits above) bs = sub_args['bucketsize'] try: self.bucketsize = int(bs) except ValueError: self.bucketsize = self.timeunits[bs] self.barstacked = not sub_args['no_stacked'] self.ylabel = "# lines per %i second bin" % self.bucketsize
def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) self.logscale = args['logscale'] # parse arguments further to get --yaxis argument argparser = argparse.ArgumentParser("mplotqueries --type scatter") argparser.add_argument('--yaxis', '-y', action='store', metavar='FIELD', default='duration') argparser.add_argument('--yaxis-regex-mode', action='store_true', default=False) args = vars(argparser.parse_args(unknown_args)) self.field = args['yaxis'] self.regex_mode = args['yaxis_regex_mode'] if self.regex_mode: self.ylabel = 'regex: "%s"' % self.field elif args['yaxis'] == 'duration': self.ylabel = 'duration in ms' else: self.ylabel = args['yaxis'] self.durlines = []
def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) # parse arguments further to get --bucketsize argument argparser = argparse.ArgumentParser("mplotqueries --type histogram") argparser.add_argument('--bucketsize', '-b', action='store', metavar='SIZE', help="histogram bucket size in seconds", default=60) argparser.add_argument('--no-stacked', action='store_true', help=("switch graph mode from stacked " "histogram (default) to side-by-side " "histograms."), default=False) sub_args = vars(argparser.parse_args(unknown_args)) self.logscale = args['logscale'] # get bucket size, either as int (seconds) or as string # (see timeunits above) bs = sub_args['bucketsize'] try: self.bucketsize = int(bs) except ValueError: self.bucketsize = self.timeunits[bs] self.barstacked = not sub_args['no_stacked'] self.ylabel = "# lines per %i second bin" % self.bucketsize
def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) # parse arguments further to get --bucketsize argument argparser = argparse.ArgumentParser("mplotqueries --type range") argparser.add_argument('--gap', action='store', metavar='SEC', type=int, help="gap threshold in seconds after which a new line is started (default: 60)", default=None) sub_args = vars(argparser.parse_args(unknown_args)) self.gap = sub_args['gap']
def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) # parse arguments further to get --bucketsize argument argparser = argparse.ArgumentParser("mplotqueries --type range") argparser.add_argument('--gap', action='store', metavar='SEC', type=int, help=("gap threshold in seconds " "after which a new line is " "started (default: 60)"), default=None) sub_args = vars(argparser.parse_args(unknown_args)) self.gap = sub_args['gap']
def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) # parse arguments further to get --yaxis argument self.argparser = argparse.ArgumentParser("mplotqueries --type scatter") self.argparser.add_argument('--yaxis', '-y', action='store', metavar='FIELD', default='duration') args = vars(self.argparser.parse_args(unknown_args)) self.field = args['yaxis'] if args['yaxis'] == 'duration': self.ylabel = 'duration in ms' else: self.ylabel = args['yaxis']
def plot(self, axis, ith_plot, total_plots, limits): artists = BasePlotType.plot(self, axis, ith_plot, total_plots, limits) # parse all groups and plot currently open number of connections artist = self.plot_total_conns(axis) artists.append(artist) return artists
def __init__(self, args=None, unknown_args=None): BasePlotType.__init__(self, args, unknown_args) # parse arguments further to get --bucketsize argument argparser = argparse.ArgumentParser("mplotqueries --type histogram") argparser.add_argument('--bucketsize', '-b', action='store', metavar='SIZE', help="histogram bucket size in seconds", default=60) sub_args = vars(argparser.parse_args(unknown_args)) self.logscale = args['logscale'] # get bucket size, either as int (seconds) or as string (see timeunits above) bs = sub_args['bucketsize'] try: self.bucketsize = int(bs) except ValueError: self.bucketsize = self.timeunits[bs] self.ylabel = "# connections opened/closed"
def __init__(self, args=None, unknown_args=None): # Only call baseplot type constructor, we don't need argparser BasePlotType.__init__(self, args, unknown_args) self.ylabel = 'nscanned / n ratio'