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

feat: add new rtt per op field to nfsclient #10787

Merged
merged 2 commits into from
Mar 11, 2022

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Mar 7, 2022

This field will provide the calculation for round-trip time per
operation. The current rtt field is the total number of time taken,
which is not very useful.

This field will provide the calculation for round-trip time per
operation. The current rtt field is the total number of time taken,
which is not very useful.
@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Mar 7, 2022
@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Mar 8, 2022
@reimda
Copy link
Contributor

reimda commented Mar 10, 2022

Is this PR supposed to be linked to an issue? It seems like a specific fix but I don't see a link

@@ -62,7 +62,8 @@ If `fullstat` is set, a great deal of additional metrics are collected, detailed
- ops (integer, count) - The number of operations of this type executed.
- retrans (integer, count) - The number of times an operation had to be retried (retrans = OP_trans - OP_ops. See nfs_ops below)
- exe (integer, miliseconds) - The number of miliseconds it took to process the operations.
- rtt (integer, miliseconds) - The round-trip time for operations.
- rtt (integer, miliseconds) - The total round-trip time for all operations.
- rtt_per_op (float, miliseconds) - The round-trip time per operation.
Copy link
Contributor

Choose a reason for hiding this comment

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

When I first read this I thought it rtt_per_op would give an exact value for each operation, but after reading the code I understand this is an average rtt per op. It might be more clear for users to add in the docs that this is an average.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, done

@@ -190,6 +190,10 @@ func (n *NFSClient) parseStat(mountpoint string, export string, version string,
fields["bytes"] = nline[3] + nline[4]
fields["rtt"] = nline[6]
fields["exe"] = nline[7]
fields["rtt_per_op"] = 0.0
if nline[0] > 0 {
fields["rtt_per_op"] = float64(nline[6]) / float64(nline[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

rtt_per_op is just rtt/ops, right? This is the kind of thing processors are meant to handle. Why not use starlark or something to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If someone is using the NFS client input plugin, they are probably monitoring their system and are interested in a number of key metrics.

Similarly, in the memory input plugin we calculate used and available percents, in the CPU plugin we calculate all sorts of usage percentages, and in the LVM plugins, we calculate used percentages as well. I feel that the NFS client, knowing your average RTT falls into this same category of something pretty much everyone is going to want to do. Asking every user to do this calculation, when we could add it seems to not be the right user experience.

I can understand not wanting Telegraf to calculate lots of different averages and other metrics, but this seems to fall in line with other monitoring and reporting of key metrics that make it hard not to have it included.

@powersj
Copy link
Contributor Author

powersj commented Mar 10, 2022

Is this PR supposed to be linked to an issue? It seems like a specific fix but I don't see a link

EAR

@reimda reimda merged commit 02c3073 into influxdata:master Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants