-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1314 from NASA-AMMOS/feature--streamline-resource…
…-profiling Add more utilities for profiling resources
- Loading branch information
Showing
7 changed files
with
152 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
contrib/src/main/java/gov/nasa/jpl/aerie/contrib/streamline/core/Resource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,31 @@ | ||
package gov.nasa.jpl.aerie.contrib.streamline.core; | ||
|
||
import gov.nasa.jpl.aerie.contrib.streamline.core.monads.ResourceMonad; | ||
import gov.nasa.jpl.aerie.contrib.streamline.debugging.Profiling; | ||
|
||
/** | ||
* A function returning a fully-wrapped dynamics, | ||
* and the primary way models track state and report results. | ||
*/ | ||
public interface Resource<D> extends ThinResource<ErrorCatching<Expiring<D>>> { | ||
/** | ||
* Turn on profiling for all resources derived through {@link ResourceMonad} | ||
* or created by {@link MutableResource#resource}. | ||
* | ||
* <p> | ||
* Calling this method once before constructing your model will profile virtually every resource. | ||
* Profiling may be compute and/or memory intensive, and should not be used in production. | ||
* </p> | ||
* <p> | ||
* If only a few resources are suspect, you can also call {@link Profiling#profile} | ||
* directly on just those resource, rather than profiling every resource. | ||
* </p> | ||
* <p> | ||
* Call {@link Profiling#dump()} to see results. | ||
* </p> | ||
*/ | ||
static void profileAllResources() { | ||
ResourceMonad.profileAllResources(); | ||
MutableResource.profileAllResources(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.