Skip to content

runtime & memory usage to body interceptors#1043

Merged
sahilagichani14 merged 8 commits intodevelopfrom
1035-feature-get-performance-of-bodyinterceptors-runtime-and-memory-consumption
Aug 29, 2024
Merged

runtime & memory usage to body interceptors#1043
sahilagichani14 merged 8 commits intodevelopfrom
1035-feature-get-performance-of-bodyinterceptors-runtime-and-memory-consumption

Conversation

@sahilagichani14
Copy link
Copy Markdown
Collaborator

No description provided.

sahilagichani14 and others added 3 commits August 27, 2024 13:06
…feature-get-performance-of-bodyinterceptors-runtime-and-memory-consumption
@sahilagichani14 sahilagichani14 marked this pull request as draft August 28, 2024 10:03
@sahilagichani14 sahilagichani14 marked this pull request as ready for review August 28, 2024 12:25
long usedMemoryAfter = runtime.totalMemory() - runtime.freeMemory();
long memoryUsed = (usedMemoryAfter - usedMemoryBefore) / MB;

biMetric.setRuntime(biMetricMap.get(bodyInterceptor).getRuntime() + duration);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Maybe in the future for Metrics objects, we might need to modify Long objects and here as well I'm setting object values for runtime and memory usage hence I used Long in BodyInterceptorMetric, and inside the runtime interceptBody calculation of that is fixed and I'm just reading the value hence I used primitive long here. @palaniappan1

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.

Project coverage is 69.41%. Comparing base (f373fd5) to head (62de894).
Report is 92 commits behind head on develop.

Files with missing lines Patch % Lines
.../sootup/core/transform/RunTimeBodyInterceptor.java 90.00% 2 Missing ⚠️
...a/sootup/core/transform/BodyInterceptorMetric.java 90.90% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1043      +/-   ##
=============================================
- Coverage      71.90%   69.41%   -2.49%     
- Complexity      4453     4468      +15     
=============================================
  Files            367      375       +8     
  Lines          16403    17062     +659     
  Branches        2748     2964     +216     
=============================================
+ Hits           11794    11843      +49     
- Misses          3694     4300     +606     
- Partials         915      919       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@palaniappan1
Copy link
Copy Markdown
Collaborator

palaniappan1 commented Aug 29, 2024

FYI, java.util.* has almost 70-80 classes & interfaces included. You just used 2 or 3 classes, then why do we need that whole package imported. I cleaned it up, so no worries :)


public class BodyInterceptorMetric {

private Long runtime;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It would be better to use long (primitive type) instead of Long (Object type), I don't see the usecase of using Object type here.

@sahilagichani14 sahilagichani14 merged commit 44526c5 into develop Aug 29, 2024
@sahilagichani14 sahilagichani14 deleted the 1035-feature-get-performance-of-bodyinterceptors-runtime-and-memory-consumption branch August 29, 2024 18:08
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.

[Feature]: Get Performance of BodyInterceptors (Runtime and Memory Consumption)

2 participants