Package org.apache.sysds.utils
Class Statistics
- java.lang.Object
-
- org.apache.sysds.utils.Statistics
-
public class Statistics extends Object
This class captures all statistics.
-
-
Field Summary
Fields Modifier and Type Field Description static longallocateDoubleArrTimestatic booleanallowWorkerStatisticsstatic longexamSparsityTimestatic longrecomputeNNZTime
-
Constructor Summary
Constructors Constructor Description Statistics()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddCPMemObject(int hash, double sizeof)static voiddecrementNoOfExecutedSPInst()static Stringdisplay()Returns statistics of the DML program that was recently completed as a stringstatic Stringdisplay(int maxHeavyHitters)Returns statistics as a stringstatic longgetCompileTime()static StringgetCPHeavyHitterCode(Instruction inst)static longgetCPHeavyHitterCount(String opcode)static Set<String>getCPHeavyHitterOpCodes()static StringgetCPHeavyHittersMem(int num)static longgetFunRecompiles()static longgetFunRecompileTime()static StringgetHeavyHitters(int num)Obtain a string tabular representation of the heavy hitter instructions that displays the time, instruction count, and optionally GPU stats about each instruction.static HashMap<String,org.apache.commons.lang3.tuple.Pair<Long,Double>>getHeavyHittersHashMap()static longgetJITCompileTime()Returns the total time of asynchronous JIT compilation in milliseconds.static longgetJVMgcCount()static longgetJVMgcTime()static longgetNoOfCompiledSPInst()static longgetNoOfExecutedSPInst()static longgetNumPinnedObjects()static longgetRunTime()Returns the total time of run in nanoseconds.static doublegetSizeofPinnedObjects()static longgetTotalLix()static longgetTotalLixUIP()static longgetTotalUIPVar()static voidincrementFunRecompiles()static voidincrementFunRecompileTime(long delta)static voidincrementJITCompileTime(long time)static voidincrementJVMgcCount(long delta)static voidincrementJVMgcTime(long time)static voidincrementNoOfCompiledSPInst()static voidincrementNoOfExecutedSPInst()static voidincrementTotalLix()static voidincrementTotalLixUIP()static voidincrementTotalUIPVar()static voidmaintainCPFuncCallStats(String instName)static voidmaintainCPHeavyHitters(String instName, long timeNanos)"Maintains" or adds time to per instruction/op timers, also increments associated countstatic voidmaintainCPHeavyHittersMem(String name, double sizeof)Helper method which keeps track of the heaviest weight objects (by total memory used) throughout execution of the program.static voidremoveCPMemObject(int hash)Helper method to remove a memory object which has become unpinnedstatic voidreset()static voidresetCPHeavyHitters()static voidresetJITCompileTime()static voidresetJVMgcCount()static voidresetJVMgcTime()static voidresetNoOfCompiledJobs(int count)static voidresetNoOfExecutedJobs()static voidstartCompileTimer()static voidstartRunTimer()Starts the timer, should be invoked immediately before invoking Program.execute()static voidstopCompileTimer()static voidstopRunTimer()Stops the timer, should be invoked immediately after invoking Program.execute()static String[]wrap(String str, int wrapLength)
-
-
-
Method Detail
-
getNoOfExecutedSPInst
public static long getNoOfExecutedSPInst()
-
incrementNoOfExecutedSPInst
public static void incrementNoOfExecutedSPInst()
-
decrementNoOfExecutedSPInst
public static void decrementNoOfExecutedSPInst()
-
getNoOfCompiledSPInst
public static long getNoOfCompiledSPInst()
-
incrementNoOfCompiledSPInst
public static void incrementNoOfCompiledSPInst()
-
getTotalUIPVar
public static long getTotalUIPVar()
-
incrementTotalUIPVar
public static void incrementTotalUIPVar()
-
getTotalLixUIP
public static long getTotalLixUIP()
-
incrementTotalLixUIP
public static void incrementTotalLixUIP()
-
getTotalLix
public static long getTotalLix()
-
incrementTotalLix
public static void incrementTotalLix()
-
resetNoOfCompiledJobs
public static void resetNoOfCompiledJobs(int count)
-
resetNoOfExecutedJobs
public static void resetNoOfExecutedJobs()
-
incrementJITCompileTime
public static void incrementJITCompileTime(long time)
-
incrementJVMgcTime
public static void incrementJVMgcTime(long time)
-
incrementJVMgcCount
public static void incrementJVMgcCount(long delta)
-
incrementFunRecompileTime
public static void incrementFunRecompileTime(long delta)
-
incrementFunRecompiles
public static void incrementFunRecompiles()
-
startCompileTimer
public static void startCompileTimer()
-
stopCompileTimer
public static void stopCompileTimer()
-
getCompileTime
public static long getCompileTime()
-
startRunTimer
public static void startRunTimer()
Starts the timer, should be invoked immediately before invoking Program.execute()
-
stopRunTimer
public static void stopRunTimer()
Stops the timer, should be invoked immediately after invoking Program.execute()
-
getRunTime
public static long getRunTime()
Returns the total time of run in nanoseconds.- Returns:
- run time in nanoseconds
-
reset
public static void reset()
-
resetJITCompileTime
public static void resetJITCompileTime()
-
resetJVMgcTime
public static void resetJVMgcTime()
-
resetJVMgcCount
public static void resetJVMgcCount()
-
resetCPHeavyHitters
public static void resetCPHeavyHitters()
-
getCPHeavyHitterCode
public static String getCPHeavyHitterCode(Instruction inst)
-
addCPMemObject
public static void addCPMemObject(int hash, double sizeof)
-
removeCPMemObject
public static void removeCPMemObject(int hash)
Helper method to remove a memory object which has become unpinned- Parameters:
hash- hash of data object
-
maintainCPHeavyHittersMem
public static void maintainCPHeavyHittersMem(String name, double sizeof)
Helper method which keeps track of the heaviest weight objects (by total memory used) throughout execution of the program. Only reported if JMLC memory statistics are enabled and finegrained statistics are enabled. We only keep track of the -largest- instance of data associated with a particular string identifier so no need to worry about multiple bindings to the same name- Parameters:
name- String denoting the variables namesizeof- objects size (estimated bytes)
-
maintainCPHeavyHitters
public static void maintainCPHeavyHitters(String instName, long timeNanos)
"Maintains" or adds time to per instruction/op timers, also increments associated count- Parameters:
instName- name of the instruction/optimeNanos- time in nano seconds
-
maintainCPFuncCallStats
public static void maintainCPFuncCallStats(String instName)
-
getCPHeavyHitterCount
public static long getCPHeavyHitterCount(String opcode)
-
getHeavyHittersHashMap
public static HashMap<String,org.apache.commons.lang3.tuple.Pair<Long,Double>> getHeavyHittersHashMap()
-
getHeavyHitters
public static String getHeavyHitters(int num)
Obtain a string tabular representation of the heavy hitter instructions that displays the time, instruction count, and optionally GPU stats about each instruction.- Parameters:
num- the maximum number of heavy hitters to display- Returns:
- string representing the heavy hitter instructions in tabular format
-
getCPHeavyHittersMem
public static String getCPHeavyHittersMem(int num)
-
getJITCompileTime
public static long getJITCompileTime()
Returns the total time of asynchronous JIT compilation in milliseconds.- Returns:
- JIT compile time
-
getJVMgcTime
public static long getJVMgcTime()
-
getJVMgcCount
public static long getJVMgcCount()
-
getFunRecompileTime
public static long getFunRecompileTime()
-
getFunRecompiles
public static long getFunRecompiles()
-
getNumPinnedObjects
public static long getNumPinnedObjects()
-
getSizeofPinnedObjects
public static double getSizeofPinnedObjects()
-
display
public static String display()
Returns statistics of the DML program that was recently completed as a string- Returns:
- statistics as a string
-
display
public static String display(int maxHeavyHitters)
Returns statistics as a string- Parameters:
maxHeavyHitters- The maximum number of heavy hitters that are printed- Returns:
- statistics as string
-
-