Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Adding GC stats to runmetrics plugin #1207

Merged
merged 4 commits into from
Feb 12, 2021
Merged

Adding GC stats to runmetrics plugin #1207

merged 4 commits into from
Feb 12, 2021

Conversation

TrevinTeacutter
Copy link
Contributor

@TrevinTeacutter TrevinTeacutter commented Apr 7, 2020

Solves (hopefully): #1188

@TrevinTeacutter TrevinTeacutter requested review from rakyll, rghetia and a team as code owners April 7, 2020 16:21
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@TrevinTeacutter
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Apr 7, 2020
plugin/runmetrics/producer.go Outdated Show resolved Hide resolved
plugin/runmetrics/producer.go Outdated Show resolved Hide resolved
return nil, err
}

memStats.pauseTotalNs, err = producer.createInt64GaugeEntry("process/pause_total", "Cumulative milliseconds spent in GC stop-the-world pauses", metricdata.UnitMilliseconds)
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate. Same as line 263.

Copy link
Contributor

Choose a reason for hiding this comment

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

All cumulative values can use AddInt64Cumulative

this allows to compute rate on certain backends.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem with AddInt64Cumulative is that it expects an incremental value, which is not how this metric can be recorded. These would be similar to how memMalloc and memFrees work in this producer in that the runtime is incrementing for you and all that you can record is the total value.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case you could use AddInt64DerivedCumulative.

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 finally did this, I also did this retroactively for the metrics that I believe are also cumulative in this runmetrics package since it seems weird to do this only for net new metrics.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for the long delay. The problem with retroactively changing the type for existing metrics is that it will fail for some backends. For example, stackdriver will reject the same metric if the type is different. But on the other hand it is the right thing to do. We'll have add release note as breaking change for this plugin.
Alternatively, it could support both options. Provide a flag to choose the option.

Copy link
Contributor Author

@TrevinTeacutter TrevinTeacutter Jun 4, 2020

Choose a reason for hiding this comment

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

Makes sense, I'll add a flag for this to ensure people can migrate at their own pace. I'm a stickler for consistency so I'd rather have that than some metrics following a newer standard while others didn't.

Copy link
Contributor Author

@TrevinTeacutter TrevinTeacutter Jun 4, 2020

Choose a reason for hiding this comment

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

However, should this flag control only be for the ones necessary to stay passive or all cumulative metrics in this package? I lean towards the latter but I can understand why someone would want the former.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really happy with this but honestly rather than have a bunch of if statements running around it made sense to have separate structures.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@TrevinTeacutter
Copy link
Contributor Author

@googlebot I fixed it

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@punya
Copy link
Contributor

punya commented Feb 12, 2021

@TrevinTeacutter would you mind updating this branch one more time, so that Github Actions can run CI? Thanks again for your patience!

@TrevinTeacutter
Copy link
Contributor Author

@punya np and done!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants