Package org.fusesource.hawtjni.runtime
Class NativeStats
- java.lang.Object
-
- org.fusesource.hawtjni.runtime.NativeStats
-
public class NativeStats extends java.lang.Object
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 Classes Modifier and Type Class Description static class
NativeStats.NativeFunction
static interface
NativeStats.StatsInterface
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap<NativeStats.StatsInterface,java.util.ArrayList<NativeStats.NativeFunction>>
snapshot
-
Constructor Summary
Constructors Modifier Constructor Description NativeStats(java.util.Collection<NativeStats.StatsInterface> classes)
private
NativeStats(java.util.HashMap<NativeStats.StatsInterface,java.util.ArrayList<NativeStats.NativeFunction>> snapshot)
NativeStats(NativeStats.StatsInterface... classes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NativeStats
copy()
NativeStats
diff()
void
dump(java.io.PrintStream ps)
Dumps the stats to the print stream in a JSON format.void
reset()
NativeStats
snapshot()
private static java.util.HashMap<NativeStats.StatsInterface,java.util.ArrayList<NativeStats.NativeFunction>>
snapshot(java.util.Collection<NativeStats.StatsInterface> classes)
void
update()
-
-
-
Field Detail
-
snapshot
private final java.util.HashMap<NativeStats.StatsInterface,java.util.ArrayList<NativeStats.NativeFunction>> snapshot
-
-
Constructor Detail
-
NativeStats
public NativeStats(NativeStats.StatsInterface... classes)
-
NativeStats
public NativeStats(java.util.Collection<NativeStats.StatsInterface> classes)
-
NativeStats
private NativeStats(java.util.HashMap<NativeStats.StatsInterface,java.util.ArrayList<NativeStats.NativeFunction>> snapshot)
-
-
Method Detail
-
reset
public void reset()
-
update
public void update()
-
snapshot
public NativeStats snapshot()
-
copy
public NativeStats copy()
-
diff
public NativeStats diff()
-
dump
public void dump(java.io.PrintStream ps)
Dumps the stats to the print stream in a JSON format.- Parameters:
ps
- Print stream.
-
snapshot
private static java.util.HashMap<NativeStats.StatsInterface,java.util.ArrayList<NativeStats.NativeFunction>> snapshot(java.util.Collection<NativeStats.StatsInterface> classes)
-
-