def analyze(self, console_log, output_dir):
        regex = r"redis-cli -s \$s keys \\'conndb...flow\\' \| wc -l" + \
                analysis.newline_re_match + "(\d+)" + analysis.newline_re
        timestamps, results = analysis.split_results(
            re.findall(regex, repr(console_log)))

        if len(timestamps) == len(results) and len(results) > 1:
            self.make_graph(results,
                            "streamboost connections",
                            "sb_connections",
                            ts=timestamps,
                            output_dir=output_dir)
        elif len(results) > 1:
            self.make_graph(results,
                            "streamboost connections",
                            "sb_connections",
                            output_dir=output_dir)

        regex = "redis-cli -s \$s scard flowdb.flows" + analysis.newline_re_match + \
                "\(integer\) (\d+)" + analysis.newline_re
        timestamps, results = analysis.split_results(
            re.findall(regex, repr(console_log)))

        if len(timestamps) == len(results) and len(results) > 1:
            self.make_graph(results,
                            "streamboost flows",
                            "sb_flows",
                            ts=timestamps,
                            output_dir=output_dir)
        if len(results) > 1:
            self.make_graph(results,
                            "streamboost flows",
                            "sb_flows",
                            output_dir=output_dir)
    def analyze(self, console_log, output_dir):
        regex = r"redis-cli -s \$s keys \\'conndb...flow\\' \| wc -l" + \
                analysis.newline_re_match + "(\d+)" + analysis.newline_re
        timestamps, results = analysis.split_results(re.findall(regex, repr(console_log)))

        if len(timestamps) == len(results) and len(results) > 1:
            self.make_graph(results, "streamboost connections", "sb_connections", ts=timestamps, output_dir=output_dir)
        elif len(results) > 1:
            self.make_graph(results, "streamboost connections", "sb_connections", output_dir=output_dir)

        regex = "redis-cli -s \$s scard flowdb.flows" + analysis.newline_re_match + \
                "\(integer\) (\d+)" + analysis.newline_re
        timestamps, results = analysis.split_results(re.findall(regex, repr(console_log)))

        if len(timestamps) == len(results) and len(results) > 1:
            self.make_graph(results, "streamboost flows", "sb_flows", ts=timestamps, output_dir=output_dir)
        if len(results) > 1:
            self.make_graph(results, "streamboost flows", "sb_flows", output_dir=output_dir)
Example #3
0
    def analyze(self, console_log, output_dir):
        regex = "cat /proc/sys/net/netfilter/nf_conntrack_count" \
                + analysis.newline_re_match + "(\d+)" + analysis.newline_re
        timestamps, results = analysis.split_results(re.findall(regex, repr(console_log)))

        if len(timestamps) == len(results) and len(results) > 1:
            self.make_graph(results, "num connections", "connections", ts=timestamps, output_dir=output_dir)
        elif len(results) > 1:
            self.make_graph(results, "num connections", "connections", output_dir=output_dir)
    def analyze(self, console_log, output_dir):
        regex = "cat /proc/sys/net/netfilter/nf_conntrack_count" \
                + analysis.newline_re_match + "(\d+)" + analysis.newline_re
        timestamps, results = analysis.split_results(
            re.findall(regex, repr(console_log)))

        if len(timestamps) == len(results) and len(results) > 1:
            self.make_graph(results,
                            "num connections",
                            "connections",
                            ts=timestamps,
                            output_dir=output_dir)
        elif len(results) > 1:
            self.make_graph(results,
                            "num connections",
                            "connections",
                            output_dir=output_dir)