hunter icon indicating copy to clipboard operation
hunter copied to clipboard

Add support for PostgreSQL

Open Gerrrr opened this issue 2 years ago • 2 comments

Thank you for opensourcing hunter!

This PR adds support to using PostgreSQL as a data source for benchmark results. See the usage example below.

Configuration:

postgres:
  hostname: ${POSTGRES_HOST}
  port: ${POSTGRES_PORT}
  username: ${POSTGRES_USERNAME}
  password: ${POSTGRES_PASSWORD}
  database: ${POSTGRES_DATABASED}
templates:
  common:
    type: postgres
    time_column: ts
    attributes: [commit]
    metrics:
    ...

Test:

  # trunk
  trunk.aggregate_mem:
    inherit: [common]
    query: |
      SELECT e.*
      FROM experiments e
      INNER JOIN setups s ON e.setup_id = s.id
      WHERE e.exclude_from_analysis = false AND
            e.branch = 'trunk' AND
            s.benchmark = 'aggregate' AND
            s.scenario = 'singleNode' AND
            s.suppress = 'NONE' AND
            s.store = 'MEM' AND
            s.cache = true AND
            s.log = true AND
            s.sink = false AND
            s.keyspace = 10000 AND
            s.key_distribution = 'normal' AND
            s.partitions = 2 AND
            s.instance_type = 'ec2i3.large'
      ORDER BY e.ts ASC;

Gerrrr avatar Jul 29 '22 08:07 Gerrrr

Thank you for the contribution. Can you add more documentation on usage and about the expected database schema?

pkolaczk avatar Aug 08 '23 13:08 pkolaczk

Hey @pkolaczk @smccarthy788 ,

I've updated this branch. It now includes requested documentation as well as PostgresExporter that completes psql support.

Can you please take another look at this PR?

Gerrrr avatar Jun 14 '24 00:06 Gerrrr