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

Remove the Format method of stats.Sink #2320

Open
oleiade opened this issue Jan 10, 2022 · 1 comment
Open

Remove the Format method of stats.Sink #2320

oleiade opened this issue Jan 10, 2022 · 1 comment
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6

Comments

@oleiade
Copy link
Member

oleiade commented Jan 10, 2022

Proposal

During our discussions about parsing and executing thresholds directly in Go, @mstoykov mentioned that we could get rid of the stats.Sink.Format method all in all.

Context

I would also, looking at this code and the other places where sink.Format is used, I kind of want to remove this method. It's in most cases used as a way to get info about values for the given sink, but then we also cast the sink to its concrete type in order to get even more info from it.
Given that there are 4 sink types, I feel like a switch in all cases (as the fields might not be the same) might be better 🤔.
Especially as it turns out that the CounterSink does actually return a rate, but the summary code overwrites it, possibly with the same value 🤦
And in the REST API where it is used "correctly" we have a minor bug about Trends and also doesn't show the same stuff as in the summary 🤦.

Status

I only report this issue as it was mentioned during a somewhat related discussion. There must be some missing context, questions, and related issues that probably need mention and being addressed before moving on. Thus, this issue could use more input from historical maintainers. Don't hesitate to provide any information or feedback you judge necessary to the resolution of this, I will add them as edits to this description.

Related

@oleiade oleiade added enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6 labels Jan 10, 2022
@yorugac
Copy link
Contributor

yorugac commented Jan 11, 2022

Just a note: this change will require modifications in Prometheus remote-write extension as it relies on current Sink interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement evaluation needed proposal needs to be validated or tested before fully implementing it in k6
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants