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

Module Metrics #1438

Merged
merged 3 commits into from
Apr 3, 2024
Merged

Module Metrics #1438

merged 3 commits into from
Apr 3, 2024

Conversation

jawalonoski
Copy link
Member

This branch revamps the module, state, and transition metrics.

Previously, use of the generate.track_detailed_transition_metrics property outputted metrics to system out. Using this feature roughly quadrupled the runtime.

This change outputs the metrics as JSON (./output/metrics/**), one file per module. Using this feature will roughly double the runtime.

Sample output looks something like this for each state, where the name of the state (e.g., Chance_of_Stroke matches a state name in the corresponding GMF module):

  "Chance_of_Stroke": {
    "entered": 58987,
    "duration": 152635104000000,
    "population": 101,
    "current": 100,
    "destinations": {
      "Stroke": 1,
      "Chance_of_Stroke": 58886
    }
  }
Field Description
entered Count, how many times this state was entered.
duration Sum of time (milliseconds) spent in this state.
population Count, how many unique individuals entered this state (this count is not reliable for submodules).
current Count, how many individuals are currently in this state at simulation end.
destinations Map of states and counts that processing transitioned to.

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

Attention: Patch coverage is 38.59649% with 35 lines in your changes are missing coverage. Please review.

Project coverage is 77%. Comparing base (94ca67d) to head (b44b6bd).
Report is 3 commits behind head on master.

Files Patch % Lines
...a/org/mitre/synthea/helpers/TransitionMetrics.java 35% 25 Missing and 1 partial ⚠️
src/main/java/org/mitre/synthea/engine/Module.java 53% 7 Missing ⚠️
...c/main/java/org/mitre/synthea/export/Exporter.java 0% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #1438    +/-   ##
=========================================
  Coverage        76%     77%            
- Complexity     3868    3948    +80     
=========================================
  Files           178     178            
  Lines         25041   25279   +238     
  Branches       3547    3624    +77     
=========================================
+ Hits          19249   19486   +237     
- Misses         4667    4677    +10     
+ Partials       1125    1116     -9     

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

Copy link
Collaborator

@hadleynet hadleynet left a comment

Choose a reason for hiding this comment

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

Tested and verified locally, just one suggestion that you can ignore if you'd prefer to keep things as is.

+ decimal(count.get(), total) + "%"));
}
System.out.println();
List<ModuleSupplier> suppliers = Module.getModuleSuppliers();
Copy link
Collaborator

@hadleynet hadleynet Apr 1, 2024

Choose a reason for hiding this comment

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

Just a thought but if you modified List<ModuleSupplier> getModuleSuppliers(Predicate<String> predicate) in Module.java to take a Predicate<ModuleSupplier> instead then you could get rid of the loop that follows while also making that method more flexible.

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds like a good idea. I'll take a look at it.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I made a change. Everything should be ready to go.

@hadleynet hadleynet merged commit 2e587be into master Apr 3, 2024
5 of 6 checks passed
@jawalonoski jawalonoski deleted the statistics branch April 3, 2024 15:11
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.

2 participants