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

Some metrics followup #177

Merged
merged 3 commits into from
Oct 15, 2019
Merged

Conversation

krnowak
Copy link
Member

@krnowak krnowak commented Oct 9, 2019

I know that the spec is going to have more changes, but I had some more work. Basically tests, more docs and some observer changes.

measurementBatches []batch
observers observerMap
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should mockMeter be defined in internal/metric package (like mock tracer)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it should be in a test-support package, not an internal one, so that users can write mock tests of their own easily. Either way, let's leave a TODO behind and not block this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

opened #203.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, that was the first thing I did. But then I got import cycles (tests in api/metric package were importing internal/metric package to get the mock meter, and that in turn imported api/metric to implement the Meter interface). So annoying. So to resolve that I would either need to make tests a different package or put the mock meter into api/metric. I went with the latter for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can move the tersts in api/metric out of the "metric" package, into "metrics_test", to break this cycle. Let's leave it for a future TODO.

api/metric/api_test.go Outdated Show resolved Hide resolved
api/metric/api_test.go Outdated Show resolved Hide resolved
measurementBatches []batch
observers observerMap
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it should be in a test-support package, not an internal one, so that users can write mock tests of their own easily. Either way, let's leave a TODO behind and not block this PR.

@rghetia
Copy link
Contributor

rghetia commented Oct 14, 2019

@krnowak can you please resolve the conflict?

@krnowak
Copy link
Member Author

krnowak commented Oct 15, 2019

Updated.

measurementBatches []batch
observers observerMap
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move the tersts in api/metric out of the "metric" package, into "metrics_test", to break this cycle. Let's leave it for a future TODO.

@rghetia rghetia merged commit 388d324 into open-telemetry:master Oct 15, 2019
@krnowak krnowak deleted the krnowak/metrics branch October 21, 2019 19:27
@krnowak krnowak mentioned this pull request Feb 28, 2020
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.

3 participants