Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CrateDB database support to the time series benchmark suite. #71

Merged
merged 1 commit into from
Jun 17, 2019

Conversation

kovrus
Copy link
Contributor

@kovrus kovrus commented May 10, 2019

The PR adds the CrateDB database support to the time series benchmark suit. CrateDB supports the PostgreSQL wire protocol v3 so we use the pgx PostgreSQL driver to connect to the database.

@CLAassistant
Copy link

CLAassistant commented May 10, 2019

CLA assistant check
All committers have signed the CLA.

@codecov-io
Copy link

codecov-io commented May 10, 2019

Codecov Report

Merging #71 into master will decrease coverage by 1.06%.
The diff coverage is 57.7%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #71      +/-   ##
==========================================
- Coverage   66.03%   64.96%   -1.07%     
==========================================
  Files          77       84       +7     
  Lines        3819     4282     +463     
==========================================
+ Hits         2522     2782     +260     
- Misses       1266     1463     +197     
- Partials       31       37       +6
Impacted Files Coverage Δ
internal/inputs/utils.go 78.26% <ø> (ø) ⬆️
cmd/tsbs_load_cratedb/processor.go 0% <0%> (ø)
cmd/tsbs_load_cratedb/main.go 0% <0%> (ø)
internal/inputs/generator_queries.go 91.4% <100%> (+0.13%) ⬆️
internal/utils/time_interval.go 96.15% <100%> (+0.32%) ⬆️
cmd/tsbs_generate_data/serialize/cratedb.go 100% <100%> (ø)
internal/inputs/generator_data.go 89.92% <100%> (+0.37%) ⬆️
cmd/tsbs_load_cratedb/creator.go 21% <21%> (ø)
cmd/tsbs_load_cratedb/scan.go 82.97% <82.97%> (ø)
query/cratedb.go 88.88% <88.88%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad198f4...1039b34. Read the comment docs.

@kovrus kovrus changed the title Add CrateDB database support. Add CrateDB database support to the time series benchmark suite. May 10, 2019
@RobAtticus RobAtticus self-requested a review May 20, 2019 15:57
@RobAtticus
Copy link
Member

Hi, thanks for doing this! We'll take a look and should have a review shortly. Apologies for the delay

sql := fmt.Sprintf(`
CREATE TABLE %s (
tags object as (%s),
ts timestamptz,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not appear to work with crate 3.3.2, I get:

SQLParseException: Cannot find data type: timestamptz (SQLSTATE XX000)

Copy link
Contributor Author

@kovrus kovrus May 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for reviewing the PR!

I've been using a nightly build for development that contains some new date time types and aliases. I've pushed a fixup, i think in this case it is ok to use the timestamp data type, it has the time with time zone semantic and will remain as it is for a couple of future releases.

Copy link
Member

@RobAtticus RobAtticus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating. We just merged a few PRs that need some changes on your end. Sorry we're doing some non-trivial refactoring recently

README.md Outdated
@@ -101,7 +102,9 @@ Variables needed:
1. a start time for the data's timestamps. E.g., `2016-01-01T00:00:00Z`
1. an end time. E.g., `2016-01-04T00:00:00Z`
1. how much time should be between each reading per device, in seconds. E.g., `10s`
1. and which database(s) you want to generate for. E.g., `timescaledb` (choose from `cassandra`, `clickhouse`, `influx`, `mongo`, `siridb` or `timescaledb`)
1. and which database(s) you want to generate for. E.g., `timescaledb`
(choose from `cassandra`, `clickhouse`, `influx`, `mongo`, `siridb`, `cratedb`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cratedb should go after clickhouse (list is in alphabetical order)

@kovrus kovrus force-pushed the crate branch 3 times, most recently from a59672f to fcfe4b5 Compare May 23, 2019 22:11
@kovrus
Copy link
Contributor Author

kovrus commented May 23, 2019

@RobAtticus please take a look at the last fixup commits. I've done necessary changes and rebased the branch with master.

@kovrus
Copy link
Contributor Author

kovrus commented Jun 5, 2019

Hi @RobAtticus, is there anything from my side that is blocking this PR from being merged?

@RobAtticus
Copy link
Member

Sorry @kovrus , we've been having an off-site this week so things have been a bit slow on our end preparing for it and this week. I'll hopefully have more time to look at it next week. As long as it's up to date rebased on master, it should be good from your end and I'll check ASAP.

Copy link
Member

@RobAtticus RobAtticus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor things left, including making sure to get rid of the old TimeInterval

for i, key := range p.tagKeys {
buf = append(buf, '"')
buf = append(buf, key...)
buf = append(buf, []byte{'"', ':', '"'}...)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be easier read as:

buf = append(buf, []byte("\":\"")...)

same with the two lines down

@@ -0,0 +1,76 @@
package utils
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file was moved to internal/utils/, so you'll need to remove this and update imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slipped out of my sight, removing it

cols []string
}

func (t *tableDef) fqn() string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// fqn returns the fully-qualified name of a table

took me a bit to figure out what fqn stood for, so maybe a comment will help others 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

godoc comments start with the name of the function, so it should start with // fqn returns...

@kovrus
Copy link
Contributor Author

kovrus commented Jun 13, 2019

@RobAtticus thanks for your time and the review! 👍 I've addressed you comments.

Copy link
Member

@RobAtticus RobAtticus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just one minor nit. Once you do that, can you squash into one commit rebased on master? Maybe with this commit message:

Add CrateDB database support

This includes support for data generation and querying for
the devops use case.

cols []string
}

func (t *tableDef) fqn() string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

godoc comments start with the name of the function, so it should start with // fqn returns...

@RobAtticus
Copy link
Member

Thanks for submitting this btw, looks great and we're happy to add CrateDB!

@kovrus kovrus force-pushed the crate branch 3 times, most recently from 71740eb to 02630a3 Compare June 17, 2019 08:05
This includes support for data generation and querying for
the devops use case.
@RobAtticus RobAtticus merged commit 3adcb55 into timescale:master Jun 17, 2019
@RobAtticus
Copy link
Member

Merged in, thanks again for contributing this!

@kovrus
Copy link
Contributor Author

kovrus commented Jun 17, 2019

@RobAtticus Thanks for the review!

@kovrus kovrus deleted the crate branch June 17, 2019 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants