The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

benchmarkanything-storage - BenchmarkAnything storage cmdline tool

SYNOPSIS

Default data format (in and out) is JSON, other formats can be specified.

  • Initialize BenchmarkAnything:

      $ benchmarkanything-storage init
  • OPTIONAL: Configure MySQL

    Iff you want to use MySQL instead of the default SQLite, then edit the just created ~/.benchmarkanything/default.cfg and in the section

     benchmarkanything:
      backend: local
      storage:
        backend:
          sql:
            dsn: dbi:SQLite:...
            #dsn: DBI:mysql:database=benchmarkanything
            #user: benchmarker
            #password: secret
            ...

    comment out the dsn:dbi:SQLite... line and uncomment the dsn:DBI:mysql... and corresponding user: and password: lines, so it now looks like:

     benchmarkanything:
      backend: local
      storage:
        backend:
          sql:
            #dsn: dbi:SQLite:...
            dsn: DBI:mysql:database=benchmarkanything
            user: benchmarker
            password: secret
            ...

    And yes, choose a better password!

    Then initialize you MySQL like this:

     $ sudo apt-get install mysql-server-5.6 mysql-client-5.6
     $ mysql -u root -p
       mysql> create database if not exists benchmarkanything;
       mysql> create user 'benchmarker'@'localhost' identified by 'secret';
       mysql> grant all privileges on benchmarkanything.* to 'benchmarker'@'localhost';
       mysql> flush privileges;
       mysql> quit;
  • Create BenchmarkAnything storage database:

      $ benchmarkanything-storage createdb

    This will ask if you are sure before it creates the actual db with tables.

  • Add data to backend storage:

      $ benchmarkanything-storage add         data.json
      $ benchmarkanything-storage add -i yaml data.yaml
  • Query backend storage for data:

      $ echo 'json_search_query' | benchmarkanything-storage search -

Input formats

The following input formats are allowed, with their according modules used to convert the input into a data structure:

 yaml   - YAML::Any (default)
 json   - JSON
 dumper - Data::Dumper (including the leading $VAR1 variable assignment)

Output formats

The following output formats are allowed:

 yaml   - YAML::Any
 json   - JSON (default)
 xml    - XML::Simple
 ini    - Config::INI::Serializer
 dumper - Data::Dumper (including the leading $VAR1 variable assignment)
 flat   - pragmatic flat output for typical unixish cmdline usage

See "Output formats" in BenchmarkAnything::Storage::Frontend::Lib for more details, especially about the flat output format.

_read_in

This function reads in a data structure. The meaning of the data depends on the sub command: for search it is a search query, for add it is an array of BenchmarkAnything data points.

_write_out

This function writes a data structure in requested output format.

ABOUT

Cmdline tool to handle BenchmarkAnything data, see http://benchmarkanything.org

SEE ALSO

For more information about the BenchmarkAnything schema, see http://www.benchmarkanything.org/.

AUTHOR

Steffen Schwigon <ss5@renormalist.net>

COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Steffen Schwigon.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.