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

Expose dispatch result to be used by other implementations #5481

Merged
merged 4 commits into from
Jun 8, 2021

Conversation

skonto
Copy link
Contributor

@skonto skonto commented Jun 8, 2021

Proposed Changes

Expose the dispatch result info struct to be able to be used externally.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Not applicable.

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 8, 2021
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 8, 2021
@skonto
Copy link
Contributor Author

skonto commented Jun 8, 2021

/assign @matzew , I need this as well kind of missed it.

@knative-prow-robot knative-prow-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 8, 2021
Comment on lines 311 to 312
Err error
Info *channel.DispatchExecutionInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer if you create getters for these two: Err() and Info()

Copy link
Contributor Author

@skonto skonto Jun 8, 2021

Choose a reason for hiding this comment

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

Done added a New.. func and getters, keeping it immutable for now (no setters) as it is a result that should not change.

@knative-prow-robot knative-prow-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 8, 2021
Comment on lines 315 to 321
func (d DispatchResult) GetDispatchResultError() error {
return d.err
}

func (d DispatchResult) GetDispatchResultInfo() *channel.DispatchExecutionInfo {
return d.info
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Too verbose :) just Info and Err are fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok :P

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/channel/fanout/fanout_message_handler.go 95.4% 92.8% -2.6

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 8, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: skonto, slinkydeveloper

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 8, 2021
@codecov
Copy link

codecov bot commented Jun 8, 2021

Codecov Report

Merging #5481 (4536e54) into main (ab3978c) will decrease coverage by 0.06%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5481      +/-   ##
==========================================
- Coverage   82.78%   82.71%   -0.07%     
==========================================
  Files         197      197              
  Lines        6093     6098       +5     
==========================================
  Hits         5044     5044              
- Misses        724      729       +5     
  Partials      325      325              
Impacted Files Coverage Δ
pkg/channel/stats_reporter.go 86.66% <ø> (ø)
pkg/channel/fanout/fanout_message_handler.go 88.05% <50.00%> (-3.42%) ⬇️

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 b05d993...4536e54. Read the comment docs.

@knative-prow-robot knative-prow-robot merged commit 92d85bf into knative:main Jun 8, 2021
skonto added a commit to skonto/eventing that referenced this pull request Jun 10, 2021
)

* expose dispatch result to be used by other implementations

* expose fields

* add getters etc

* less verbose
openshift-merge-robot pushed a commit to openshift/knative-eventing that referenced this pull request Jun 10, 2021
…venting-kafka (#1311)

* make eventing metrics generic

* Expose dispatch result to be used by other implementations (knative#5481)

* expose dispatch result to be used by other implementations

* expose fields

* add getters etc

* less verbose
skonto added a commit to skonto/eventing that referenced this pull request Jun 16, 2021
)

* expose dispatch result to be used by other implementations

* expose fields

* add getters etc

* less verbose
openshift-merge-robot pushed a commit to openshift/knative-eventing that referenced this pull request Jun 17, 2021
…ka (#1318)

* make eventing metrics generic (knative#5478)

* Expose dispatch result to be used by other implementations (knative#5481)

* expose dispatch result to be used by other implementations

* expose fields

* add getters etc

* less verbose

* Use transformers efficiently for extracting info for metrics in Kafka Channel  (knative#5505)

* use transformers for extracting event type for metrics

* fix

* fix

* pass transformers to executeRequest (knative#5512)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants