Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad AttributeLoad NameLoad attr body Expr Str Assign NameStore BinOpMod Str TupleLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot NameLoad body Assign NameStore ListLoad Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str For NameStore NameLoad body If CompareEq NameLoad Str body Expr Yield SubscriptLoad NameLoad Index Num Continue If CompareEq NameLoad Str body Expr Yield SubscriptLoad NameLoad Index Num Continue TryExcept body Expr Yield SubscriptLoad NameLoad Index Call NameLoad NameLoad Continue handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Pass For NameStore NameLoad body If BoolOpOr CompareEq NameLoad Str CompareEq NameLoad SubscriptLoad NameLoad Index Str body Expr Yield NameLoad handlers ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Str keyword NameLoad Return decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad AttributeLoad NameLoad attr body Expr Str If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr For NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Str body Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Expr Str For NameStore Call NameLoad Call NameLoad keyword NameLoad keyword NameLoad body For NameStore Call NameLoad Call NameLoad keyword NameLoad keyword SubscriptLoad NameLoad Index Str body Assign NameStore Dict Str Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Str Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num body Expr Str If CompareIsNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore ListComp NameLoad comprehension NameStore NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body If CompareIn Call NameLoad NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad orelse If CompareIs Call NameLoad NameLoad NameLoad body For NameStore NameLoad body Expr Call NameLoad keyword SubscriptLoad NameLoad Index NameLoad keyword IfExp NameLoad BinOpMod Str TupleLoad NameLoad NameLoad NameLoad orelse If CompareIn Call NameLoad NameLoad ListLoad NameLoad NameLoad NameLoad body For TupleStore NameStore NameStore Call NameLoad NameLoad body Expr Call NameLoad keyword NameLoad keyword IfExp NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Call NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str NameLoad decorator_list Assign NameStore Call NameLoad Expr Call NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Assign NameStore ListComp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore ListComp Call NameLoad keyword NameLoad keyword NameLoad comprehension NameStore NameLoad FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad NameLoad Return TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str decorator_list Assign NameStore Call NameLoad NameLoad keyword NameLoad Assign NameStore ListComp Call NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Lambda arguments args NameParam defaults SubscriptLoad Call NameLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad keyword Lambda arguments args NameParam defaults SubscriptLoad Call NameLoad SubscriptLoad NameLoad Index Num Index Str Return NameLoad decorator_list Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Assign NameStore ListComp SubscriptLoad NameLoad Index Num comprehension NameStore SubscriptLoad NameLoad Index Num Assign NameStore ListComp ListComp SubscriptLoad NameLoad Index Num comprehension NameStore NameLoad comprehension NameStore NameLoad If CompareEq NameLoad Str body FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad Str attr ListComp NameLoad comprehension NameStore NameLoad CompareNotIn NameLoad Str Return NameLoad decorator_list Assign NameStore ListComp Call AttributeLoad Str attr SubscriptLoad Call AttributeLoad NameLoad attr Str Slice Num comprehension NameStore NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad orelse If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad orelse Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad Call NameLoad keyword NameLoad keyword NameLoad Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad For NameStore NameLoad body Expr Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad AttributeLoad NameLoad attr body Expr Str For NameStore Call NameLoad Call NameLoad keyword NameLoad keyword NameLoad NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad For NameStore Call NameLoad Call NameLoad NameLoad SubscriptLoad NameLoad Index Str keyword NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Expr Call NameLoad NameLoad Return decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad AttributeLoad NameLoad attr body If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse For NameStore Call NameLoad Call NameLoad NameLoad keyword NameLoad keyword NameLoad body For NameStore Call NameLoad Call NameLoad NameLoad keyword SubscriptLoad NameLoad Index Str keyword NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return decorator_list
N/A N/A Code for retrieving, analyzing, and displaying recorded benchmark data.  __future__ print_function N/A itertools N/A logging N/A json N/A collections N/A re N/A types N/A sys N/A csv N/A tabulate N/A esbench N/A logger N/A N/A logging getLogger __name__ _get_benchmarks N/A N/A conn stats_index_name N/A None N/A esbench STATS_INDEX_NAME N/A N/A Call the ES server for raw benchmark records. N/A path N/A %s/bench/_search?sort=benchmark_start:asc&size=100 N/A stats_index_name N/A resp N/A N/A conn get path N/A resp N/A _benchmarks N/A N/A resp benchmark_ids N/A None N/A N/A Process response from _get_benchmarks(), yielding benchmark dicts. N/A N/A benchmark_ids N/A N/A benchmark_ids N/A all N/A data N/A N/A json loads N/A resp data N/A N/A N/A benchmarks N/A N/A data N/A hits N/A hits N/A benchmark_id benchmark_ids N/A N/A N/A benchmark_id first N/A N/A N/A N/A benchmarks N/A 0 N/A N/A N/A benchmark_id last N/A N/A N/A N/A benchmarks N/A -1 N/A N/A N/A N/A N/A N/A benchmarks N/A N/A int benchmark_id N/A N/A N/A N/A N/A ValueError IndexError N/A exc N/A N/A N/A benchmark benchmarks N/A N/A N/A N/A benchmark_id all N/A benchmark_id N/A benchmark N/A _id N/A N/A N/A benchmark N/A N/A N/A KeyError N/A N/A N/A N/A logger warning no benchmarks found exc_info False N/A N/A _get_observations N/A N/A conn benchmark_id stats_index_name N/A None None N/A esbench STATS_INDEX_NAME N/A N/A Call the ES server for raw observation records. N/A N/A benchmark_id N/A N/A N/A ValueError invalid 'benchmark_id' N/A path N/A %s/obs/_search?q=meta.benchmark_id:%s&sort=meta.observation_start:asc&size=10000 N/A stats_index_name benchmark_id N/A resp N/A N/A conn get path N/A resp N/A _observations N/A N/A resp N/A N/A N/A Process response from _get_observations(), yielding observation dicts. N/A data N/A N/A json loads N/A resp data N/A observation N/A N/A data N/A hits N/A hits N/A N/A N/A observation N/A get_data N/A N/A conn benchmark_ids N/A None None N/A N/A Get benchmark and observation data.

    Args:
        conn: instance of esbench.api.Conn
        benchmark_ids: list of str, ids of benchmarks to be included, default
            None. When None, include all benchmarks.

    Yields:
        For each observation associated with included benchmark a dict where
        top level keys are 'benchmark' and 'observation', containing pertinent
        data. Effectively, data is denormalized, with the 'benchmark' element
        being the same for all observations for that benchmark.
     N/A benchmark N/A _benchmarks N/A _get_benchmarks conn conn benchmark_ids benchmark_ids N/A N/A observation N/A _observations N/A _get_observations conn conn benchmark_id N/A benchmark N/A _id N/A N/A data N/A benchmark observation N/A benchmark N/A _source N/A observation N/A _source N/A N/A data N/A filter_tuples N/A N/A tuples pattern key_f N/A None .* N/A N/A N/A x N/A N/A x N/A 0 N/A N/A Return tuples matching provided regex.

    Given a list of tuples and a regex pattern string, apply the regex to
    the specified tuple element, returning only tuples which match.

    Args:
        tuples: list of tuples
        pattern: string, regex pattern defauls to '.*'
        key_f: function for selecting tuple element against which the regex
            will be matched, defaults to the first element of each tuple
            (lambda x: x[0])

    Returns:
        sorted list of tuples where regex matched. The key for sorting is the
        same key used for matching.

    Raises:
        TypeError on invalid input

     N/A N/A N/A type tuples list N/A N/A N/A TypeError 'tuples' must be a list of tuples N/A compiled N/A N/A re compile pattern N/A re IGNORECASE N/A filtered N/A t N/A t tuples N/A N/A compiled match N/A key_f t N/A N/A sorted filtered key key_f N/A flatten_container N/A N/A container N/A None N/A N/A Flattens a container (dict, list, set).

    Args:
        container: a dict, list, set, tuple, any nested combination of.

    Returns:
        list of tuples (name, value) where name is a flattened, period-joined
        list of dict keys and list indexes identifying the value's original
        location in the source container, for example: "foo.bar.2.baz". The
        'value' is an int, float, str, unicode, bool, or None.

     _flatten N/A N/A container prefix N/A container None N/A N/A N/A N/A type container N/A str unicode int long float bool N/A types NoneType N/A N/A N/A N/A flat append N/A prefix container N/A N/A N/A N/A type container dict N/A N/A key container N/A N/A N/A _flatten container N/A container N/A key prefix N/A prefix N/A %s.%s N/A prefix key key N/A N/A N/A N/A type container N/A list set tuple N/A N/A N/A n v N/A enumerate container N/A N/A N/A _flatten container v prefix N/A prefix N/A %s.%i N/A prefix n N/A str n N/A N/A N/A ValueError N/A cannot process element: %s container N/A N/A flat N/A list N/A N/A _flatten N/A flat N/A group_observations N/A N/A data fields N/A None None N/A N/A data_flattened N/A N/A flatten_container d N/A d data N/A data_filtered N/A N/A filter_tuples tuples t pattern fields N/A t data_flattened sort_f N/A N/A d N/A N/A N/A _d N/A dict d N/A N/A N/A _d N/A observation.meta.benchmark_id N/A _d N/A observation.meta.observation_sequence_no N/A N/A data_sorted N/A sorted data_filtered key sort_f N/A groups N/A N/A list benchmark_obs N/A N/A benchmark_id benchmark_obs N/A N/A itertools groupby data_sorted N/A N/A N/A x N/A N/A N/A dict x N/A observation.meta.benchmark_id N/A groups_sorted N/A sorted groups key N/A N/A N/A x N/A N/A N/A dict N/A x N/A 0 N/A benchmark.meta.benchmark_start N/A groups_sorted N/A N/A FIELDS (?!observation.segments.segments)((benchmark.meta.benchmark_start)|(observation.meta.benchmark_id)|(observation.meta.observation_id)|(observation.meta.observation_sequence_no)|(observation.segments.num_committed_segments)|(observation.segments.num_search_segments)|(observation.segments.t_optimize_in_millis)|(observation.stats.docs.count)|(observation.stats.store.size_in_bytes)|(observation.stats.fielddata.memory_size_in_bytes)|(observation.stats.search.groups.*query_time_in_millis_per_query$)) output_benchmark N/A N/A fh fmt observations N/A None None None N/A N/A keys N/A N/A t N/A 0 N/A t N/A observations N/A 0 N/A values N/A N/A N/A t N/A 1 N/A t o N/A o observations N/A N/A fmt tab N/A _shorten N/A N/A s N/A N/A N/A s N/A N/A join N/A c N/A c s N/A c aeiou N/A s N/A N/A keys N/A N/A N/A . join N/A N/A N/A k split . N/A -2 N/A k keys N/A N/A print N/A N/A tabulate tabulate values headers keys file fh N/A N/A N/A fmt csv N/A N/A writer N/A N/A csv writer fh delimiter N/A N/A N/A writer writerow keys N/A N/A N/A writer writerows values N/A N/A N/A ValueError N/A unknown output format: %s fmt N/A show_benchmarks N/A N/A conn benchmark_ids fields fmt fh N/A None None None None None N/A N/A data N/A list N/A get_data conn conn benchmark_ids benchmark_ids N/A benchmarks N/A group_observations data data fields fields N/A b benchmarks N/A N/A N/A output_benchmark fh fh fmt fmt observations b N/A dump_benchmarks N/A N/A conn benchmark_ids stats_index_name N/A None None N/A esbench STATS_INDEX_NAME N/A N/A Dump benchmark data as a sequence of curl calls.

    You can save these calls to a file, and then replay them somewhere else.
     N/A benchmark N/A _benchmarks N/A _get_benchmarks conn conn stats_index_name stats_index_name benchmark_ids N/A N/A curl N/A curl -XPUT 'http://localhost:9200/%s/bench/%s' -d '%s' N/A stats_index_name N/A benchmark N/A _id N/A N/A json dumps N/A benchmark N/A _source N/A N/A print curl N/A o N/A _observations N/A _get_observations conn N/A benchmark N/A _id stats_index_name stats_index_name N/A N/A curl N/A curl -XPUT 'http://localhost:9200/%s/obs/%s' -d '%s' N/A stats_index_name N/A o N/A _id N/A N/A json dumps N/A o N/A _source N/A N/A print curl N/A N/A delete_benchmarks N/A N/A conn benchmark_ids stats_index_name N/A None None N/A esbench STATS_INDEX_NAME N/A N/A N/A benchmark_ids N/A N/A resp N/A N/A conn delete stats_index_name N/A N/A N/A logger info N/A resp curl N/A N/A benchmark N/A _benchmarks N/A _get_benchmarks conn stats_index_name stats_index_name benchmark_ids benchmark_ids N/A N/A observation N/A _observations N/A _get_observations conn benchmark_id N/A benchmark N/A _id stats_index_name stats_index_name N/A N/A path N/A %s/obs/%s N/A stats_index_name N/A observation N/A _id N/A resp N/A N/A conn delete path N/A N/A N/A logger info N/A resp curl N/A path N/A %s/bench/%s N/A stats_index_name N/A benchmark N/A _id N/A resp N/A N/A conn delete path N/A N/A N/A logger info N/A resp curl N/A N/A