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

Drop NetTrail - emit iterations metrics in runner instead of dialer #3908

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

mstoykov
Copy link
Contributor

What?

Drop the NetTrail container and emit iterations metric in runner instead of in Dialer.

Also fix #1605

Why?

As part of looking over issues I found #1250 which has some additional work required. But dropping the specific NetTrail and moving the code around was really simple.

FIxing some of the test took a bit more time :(

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

#1250
#1605

This is an artifact of both data sent/received and iterations being in
the same SampleContainer. So where one was emitted we needed to emit the
other.

That hasn't been a requirement for a while as evident by the dropping of
NetTrail with no breaking in outputs.

This also stops emitting `iteration_duration` in not default functions
(teardown, setup) as it already does for `iterations`.

Closes #1605
Part of #1250
@mstoykov mstoykov added this to the v0.54.0 milestone Aug 22, 2024
@mstoykov mstoykov requested a review from a team as a code owner August 22, 2024 10:08
@mstoykov mstoykov requested review from olegbespalov and joanlopez and removed request for a team August 22, 2024 10:08
Copy link
Contributor

@olegbespalov olegbespalov 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, left two minors

if v, ok := tags["customTag"]; ok && v == "value" {
gotNetTrailTag = true
for _, s := range sample.GetSamples() {
if s.Metric.Name == metrics.DataSentName && !gotNetTrailTag {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: after the change, this gotNetTrailTag could confuse

@@ -69,17 +69,14 @@ func (d *Dialer) DialContext(ctx context.Context, proto, addr string) (net.Conn,
return conn, err
}

// GetTrail creates a new NetTrail instance with the Dialer
// Sample creates a new NetTrail instance with the Dialer
Copy link
Contributor

Choose a reason for hiding this comment

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

How about naming this something like ReadsWritesSamples or IOSamples, something more precise? Also, a method comment not longer valid 😢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant it more like hte verb "sample" as in dialer samples whatever it has to sample and returns it. But it isn't a thing we usually do so I had it renamed

@mstoykov mstoykov merged commit 93c7083 into master Aug 22, 2024
23 checks passed
@mstoykov mstoykov deleted the dropNetTrail branch August 22, 2024 13:28
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.

setup() function creates an iteration metric
3 participants