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

Add MemoryInfo to sentry event #1337

Merged
merged 29 commits into from
Dec 16, 2021
Merged

Add MemoryInfo to sentry event #1337

merged 29 commits into from
Dec 16, 2021

Conversation

SimonCropp
Copy link
Contributor

@SimonCropp SimonCropp commented Nov 23, 2021

fixes #627

@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2021

Codecov Report

Merging #1337 (b064d72) into main (eb191c9) will increase coverage by 1.65%.
The diff coverage is 100.00%.

❗ Current head b064d72 differs from pull request most recent head 6e234b2. Consider uploading reports for the commit 6e234b2 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1337      +/-   ##
==========================================
+ Coverage   81.36%   83.01%   +1.65%     
==========================================
  Files         216      217       +1     
  Lines        7180     7295     +115     
  Branches     1410     1411       +1     
==========================================
+ Hits         5842     6056     +214     
+ Misses        912      804     -108     
- Partials      426      435       +9     
Impacted Files Coverage Δ
src/Sentry/Internal/MainSentryEventProcessor.cs 92.70% <100.00%> (+3.00%) ⬆️
src/Sentry/Internal/MemoryInfo.cs 100.00% <100.00%> (ø)
src/Sentry/Internal/AppDomainAdapter.cs 66.66% <0.00%> (ø)
src/Sentry/PlatformAbstractions/RuntimeInfo.cs 58.62% <0.00%> (+5.17%) ⬆️
...ntry/Integrations/NetFxInstallationsIntegration.cs 57.14% <0.00%> (+28.57%) ⬆️
...ntry/PlatformAbstractions/FrameworkInstallation.cs 62.50% <0.00%> (+37.50%) ⬆️
...rmAbstractions/NetFxInstallationsEventProcessor.cs 72.72% <0.00%> (+68.18%) ⬆️
...Sentry/PlatformAbstractions/FrameworkInfo.NetFx.cs 70.42% <0.00%> (+70.42%) ⬆️
src/Sentry/PlatformAbstractions/FrameworkInfo.cs 100.00% <0.00%> (+100.00%) ⬆️
...ntry/PlatformAbstractions/RegistryKeyExtensions.cs 100.00% <0.00%> (+100.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb191c9...6e234b2. Read the comment docs.

@bruno-garcia
Copy link
Member

I like this!

@SimonCropp
Copy link
Contributor Author

@bruno-garcia does this need extra tests? and if so, is there any similar tests i can use as a template?

@bruno-garcia
Copy link
Member

@bruno-garcia does this need extra tests? and if so, is there any similar tests i can use as a template?

I'm looking at tests on MainEventProcessor and some make sense:

[Fact]
public void Process_DifferentCultureInfoAndCultureUiInfo_CultureInfoAndCultureUiInfoSet()
{
//Arrange
var sut = _fixture.GetSut();
var evt = new SentryEvent(new Exception());
CultureInfo.CurrentCulture = new CultureInfo(1041);
CultureInfo.CurrentUICulture = new CultureInfo(1033);
//Act
evt = sut.Process(evt);
//Assert
Assert.True(evt.Contexts.ContainsKey(MainSentryEventProcessor.CurrentUiCultureKey));
Assert.True(evt.Contexts.ContainsKey(MainSentryEventProcessor.CultureInfoKey));
}

Though things that have side effect are not being rolled back, now that I see it. Like:

CultureInfo.CurrentCulture = new CultureInfo(1042);
CultureInfo.CurrentUICulture = new CultureInfo(1042);

@SimonCropp SimonCropp marked this pull request as ready for review December 14, 2021 22:15
Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

:shipit:

@SimonCropp SimonCropp added this to the 3.13.0 milestone Dec 16, 2021
@SimonCropp SimonCropp merged commit 12c46e1 into main Dec 16, 2021
@SimonCropp SimonCropp deleted the AddMemoryInfo branch December 16, 2021 01:10
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Fixes
Copy link
Member

Choose a reason for hiding this comment

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

Oh, we should've added this as feature. Rolled out as 3.12.3

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.

Add runtime memory information to event
5 participants