Exemplo n.º 1
0
def main(input_data: pathlib.Path, plot_dir: pathlib.Path):
    # plot_dir = plot_dir / input_data.stem
    plot_dir.mkdir(exist_ok=True, parents=True)

    data = fm.load_logs(input_data)

    plot_function_execution_time(data, plot_dir)
    plot_function_execution_time_frontend(data, plot_dir)
    plot_platform_transport_times(data, plot_dir)
def main(logpath: pathlib.Path, output: pathlib.Path):
    output = output / logpath.name
    output.mkdir(exist_ok=True, parents=True)

    platform_logs = {
        f.stem.split("_")[-1]: fm.load_logs(f)
        for f in logpath.glob("*.json")
    }

    plot_platform_comparison(platform_logs, output)
def main(logdump: pathlib.Path):
    """Print the function tree.

    Args:
        logdump: Path to log json dump.
    """

    data = fm.load_logs(logdump)

    print_function_tree(data)
Exemplo n.º 4
0
def main(input_data: pathlib.Path, out_name: pathlib.Path):
    """Exports a log dump to a given format.

    Args:
        input_data: File containing raw log entries.
        out_name: Destination path for the export, currently supported extensions are [.cvs, .xlsx]
    """
    if out_name.suffix not in EXPORTERS:
        print(f"Unknown extension {out_name.suffix}")
        return
    data = fm.load_logs(input_data)
    df = pd.json_normalize(map(asdict, data))
    EXPORTERS[out_name.suffix](df, out_name)
Exemplo n.º 5
0
def main(
        data: pathlib.Path,
        output: pathlib.Path,
        style: str = "classic",
        ftree: str = None,
        context: str = None,
        degree: int = 0,
        xpair: bool = False,
        functions: List[str] = list(),
        notime: bool = False):
    """
    Args:
        data: Path to json log dump.
        output: Output graph folder.
        style: Set style of output graph.
        functions: Only show specific functions in graph. (eg "[frontend, add]")
        degree: Minimal node degree filter.
        context: Filter on context id.
        ftree: Only show functions that are connected with the given function.
        notime: Hide rpcIn and rpcOut times.
        xpair: Show separate xpairs in individual nodes.
    """
    if output.suffix != ".png":
        output = output / data.stem
        output.mkdir(parents=True, exist_ok=True)

    data = fm.load_logs(data)
    graph_filters = {
        "function_tree": ftree,
        "functions_only": functions,
        "context_id": context,
        "min_degree": degree,
        "xpair": xpair,
        "show_time": not notime,
    }
    analyze_tree(data, output, style, graph_filters)