-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved profiler interface to dataset module
- Loading branch information
Showing
14 changed files
with
227 additions
and
199 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
10 changes: 2 additions & 8 deletions
10
chartfx-chart/src/main/java/io/fair_acc/chartfx/axes/Axis.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
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
138 changes: 0 additions & 138 deletions
138
chartfx-chart/src/main/java/io/fair_acc/chartfx/profiler/DurationMeasure.java
This file was deleted.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
chartfx-chart/src/main/java/io/fair_acc/chartfx/profiler/Profilers.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package io.fair_acc.chartfx.profiler; | ||
|
||
import io.fair_acc.dataset.profiler.Profiler; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
/** | ||
* Convenience methods for creating commonly used profilers | ||
* | ||
* @author ennerf | ||
*/ | ||
public interface Profilers { | ||
|
||
/** | ||
* A low-overhead hdr histogram recorder that writes an aggregate histogram to disk once a second. | ||
* Check <a href="http://hdrhistogram.org/">hdrhistogram.org</a> for more information | ||
* | ||
* @param fileName the disk file | ||
* @return hdr histogram profiler | ||
*/ | ||
static HdrHistogramProfiler hdrHistogramProfiler(String fileName) { | ||
return HdrHistogramProfiler.createStarted(fileName, 1, TimeUnit.SECONDS); | ||
} | ||
|
||
/** | ||
* A profiler that creates a new stage and renders the measures in real time | ||
* | ||
* @param title title of the chart | ||
* @return a chart profiler | ||
*/ | ||
static ChartProfiler chartProfiler(String title) { | ||
return ChartProfiler.showInNewStage(title); | ||
} | ||
|
||
} |
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
45 changes: 45 additions & 0 deletions
45
chartfx-dataset/src/main/java/io/fair_acc/dataset/profiler/DurationMeasure.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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package io.fair_acc.dataset.profiler; | ||
|
||
/** | ||
* Gets called before and after an action. May record time. | ||
* | ||
* @author ennerf | ||
*/ | ||
public interface DurationMeasure { | ||
|
||
/** | ||
* Called when an action begins. Sets the start timestamp. | ||
*/ | ||
void start(); | ||
|
||
/** | ||
* Called when an action is done. Records delta from the start timestamp. | ||
*/ | ||
void stop(); | ||
|
||
/** | ||
* Calling stop without start is typically an invalid call that may throw an | ||
* error. This method explicitly allows it and simply ignores bad measurements. | ||
* | ||
* @return this | ||
*/ | ||
default DurationMeasure ignoreMissingStart() { | ||
return this; | ||
} | ||
|
||
/** | ||
* A default implementation that does nothing and may be eliminated at runtime | ||
*/ | ||
public static final DurationMeasure DISABLED = new DurationMeasure() { | ||
@Override | ||
public void start() { | ||
//no-op | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
// no-op | ||
} | ||
}; | ||
|
||
} |
Oops, something went wrong.