Skip to content

feat: Add managed API for destination plugins#521

Merged
kodiakhq[bot] merged 30 commits intomainfrom
feat/managed_destinations
Dec 21, 2022
Merged

feat: Add managed API for destination plugins#521
kodiakhq[bot] merged 30 commits intomainfrom
feat/managed_destinations

Conversation

@yevgenypats
Copy link
Copy Markdown
Contributor

@yevgenypats yevgenypats commented Dec 21, 2022

This adds a managed API for destination plugins.

Closes #518 as it got destroyed with conflicts.

This should go with that: cloudquery/cloudquery#5805

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 21, 2022

⏱️ Benchmark results

Comparing with 1fe91cb

  • DefaultConcurrency-2 resources/s: 10,784 ⬇️ 15.23% decrease vs. 1fe91cb
  • Glob-2 ns/op: 184 ⬇️ 9.73% decrease vs. 1fe91cb
  • TablesWithChildrenDefaultConcurrency-2 resources/s: 29,674 ⬆️ 2.96% increase vs. 1fe91cb
  • BufferedScanner-2 ns/op: 12.01 ⬆️ 0.83% increase vs. 1fe91cb
  • LogReader-2 ns/op: 35.68 ⬇️ 7.71% decrease vs. 1fe91cb

@github-actions github-actions bot added feat and removed feat labels Dec 21, 2022
@erezrokah erezrokah self-requested a review December 21, 2022 09:14
@hermanschaaf hermanschaaf changed the title feat: Add managed API for destiantion plugins feat: Add managed API for destination plugins Dec 21, 2022
@github-actions github-actions bot added feat and removed feat labels Dec 21, 2022
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf left a comment

Choose a reason for hiding this comment

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

Mostly looks good - left a couple of questions / possible points for discussion

return false
}

if dst.Time.Sub(value.Time) < 1*time.Second {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oof, this might bite us later. Why is it necessary to round to 1 second?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah. ok I think I work around that with rounding up our auto-generated data in the tests to seconds. I only hit this snag in csvs.

yevgenypats and others added 7 commits December 21, 2022 13:43
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>

type Option func(*client)

func WithErrOnWrite() Option {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Intended for testing, these options should have Test somewhere (either godoc or in the option name, like WithTestingErrOnWrite, WithTestingBlockingWrite)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

those are all under internal so it can't be exported anyway for outside use.

Copy link
Copy Markdown
Member

@erezrokah erezrokah left a comment

Choose a reason for hiding this comment

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

Looks good, but we might want to try and make the managed writer code easier to follow in future PRs.

Had two non blocking comments

}
resources = make([][]interface{}, 0)
}
case done := <-flush:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's the reason we need the flush? Won't closing ch have the same result?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

because write can be called multiple times so we need to wait for a flush from a specific worker and we can't close the channel as other worker might be still using this worker, so we just wanted to do a flush.

yevgenypats and others added 14 commits December 21, 2022 15:26
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Erez Rokah <erezrokah@users.noreply.github.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
Co-authored-by: Herman Schaaf <hermanschaaf@gmail.com>
@kodiakhq kodiakhq bot merged commit 3df6129 into main Dec 21, 2022
@kodiakhq kodiakhq bot deleted the feat/managed_destinations branch December 21, 2022 14:25
kodiakhq bot pushed a commit that referenced this pull request Dec 21, 2022
🤖 I have created a release *beep* *boop*
---


## [1.13.0](v1.12.7...v1.13.0) (2022-12-21)


### Features

* Add managed API for destination plugins ([#521](#521)) ([3df6129](3df6129))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
kodiakhq bot pushed a commit to cloudquery/cloudquery that referenced this pull request Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants