synthetichealth / synthea

Synthetic Patient Population Simulator
https://synthetichealth.github.io/synthea
Apache License 2.0
2.19k stars 655 forks source link

Module Metrics #1438

Closed jawalonoski closed 7 months ago

jawalonoski commented 8 months ago

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.
codecov[bot] commented 8 months ago

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 :warning:
src/main/java/org/mitre/synthea/engine/Module.java 53% 7 Missing :warning:
...c/main/java/org/mitre/synthea/export/Exporter.java 0% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.