Package org.fusesource.hawtjni.runtime
Class NativeStats
java.lang.Object
org.fusesource.hawtjni.runtime.NativeStats
Instructions on how to use the NativeStats tool with a standalone SWT
example:
- Compile the native libraries defining the NATIVE_STATS flag.
- Add the following code around the sections of
interest to dump the native calls done in that section.
StatsInterface si = MyFooStatsInterface.INSTANCE; NativeStats stats = new NativeStats(si); ... // your code stats.diff().dump(System.out);
- Or add the following code at a given point to dump a snapshot of
the native calls done until that point.
stats.snapshot().dump(System.out);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashMap<NativeStats.StatsInterface,
ArrayList<NativeStats.NativeFunction>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionNativeStats
(Collection<NativeStats.StatsInterface> classes) private
NativeStats
(NativeStats.StatsInterface... classes) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
diff()
void
dump
(PrintStream ps) Dumps the stats to the print stream in a JSON format.void
reset()
snapshot()
private static HashMap<NativeStats.StatsInterface,
ArrayList<NativeStats.NativeFunction>> snapshot
(Collection<NativeStats.StatsInterface> classes) void
update()
-
Field Details
-
snapshot
-
-
Constructor Details
-
NativeStats
-
NativeStats
-
NativeStats
private NativeStats(HashMap<NativeStats.StatsInterface, ArrayList<NativeStats.NativeFunction>> snapshot)
-
-
Method Details
-
reset
public void reset() -
update
public void update() -
snapshot
-
copy
-
diff
-
dump
Dumps the stats to the print stream in a JSON format.- Parameters:
ps
- Print stream.
-
snapshot
private static HashMap<NativeStats.StatsInterface,ArrayList<NativeStats.NativeFunction>> snapshot(Collection<NativeStats.StatsInterface> classes)
-