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 SummaryFields Modifier and Type Field Description static longallocateDoubleArrTimestatic booleanallowWorkerStatisticsstatic longexamSparsityTimestatic longrecomputeNNZTime
 - 
Constructor SummaryConstructors Constructor Description Statistics()
 - 
Method SummaryAll 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- 
getNoOfExecutedSPInstpublic static long getNoOfExecutedSPInst() 
 - 
incrementNoOfExecutedSPInstpublic static void incrementNoOfExecutedSPInst() 
 - 
decrementNoOfExecutedSPInstpublic static void decrementNoOfExecutedSPInst() 
 - 
getNoOfCompiledSPInstpublic static long getNoOfCompiledSPInst() 
 - 
incrementNoOfCompiledSPInstpublic static void incrementNoOfCompiledSPInst() 
 - 
getTotalUIPVarpublic static long getTotalUIPVar() 
 - 
incrementTotalUIPVarpublic static void incrementTotalUIPVar() 
 - 
getTotalLixUIPpublic static long getTotalLixUIP() 
 - 
incrementTotalLixUIPpublic static void incrementTotalLixUIP() 
 - 
getTotalLixpublic static long getTotalLix() 
 - 
incrementTotalLixpublic static void incrementTotalLix() 
 - 
resetNoOfCompiledJobspublic static void resetNoOfCompiledJobs(int count) 
 - 
resetNoOfExecutedJobspublic static void resetNoOfExecutedJobs() 
 - 
incrementJITCompileTimepublic static void incrementJITCompileTime(long time) 
 - 
incrementJVMgcTimepublic static void incrementJVMgcTime(long time) 
 - 
incrementJVMgcCountpublic static void incrementJVMgcCount(long delta) 
 - 
incrementFunRecompileTimepublic static void incrementFunRecompileTime(long delta) 
 - 
incrementFunRecompilespublic static void incrementFunRecompiles() 
 - 
startCompileTimerpublic static void startCompileTimer() 
 - 
stopCompileTimerpublic static void stopCompileTimer() 
 - 
getCompileTimepublic static long getCompileTime() 
 - 
startRunTimerpublic static void startRunTimer() Starts the timer, should be invoked immediately before invoking Program.execute()
 - 
stopRunTimerpublic static void stopRunTimer() Stops the timer, should be invoked immediately after invoking Program.execute()
 - 
getRunTimepublic static long getRunTime() Returns the total time of run in nanoseconds.- Returns:
- run time in nanoseconds
 
 - 
resetpublic static void reset() 
 - 
resetJITCompileTimepublic static void resetJITCompileTime() 
 - 
resetJVMgcTimepublic static void resetJVMgcTime() 
 - 
resetJVMgcCountpublic static void resetJVMgcCount() 
 - 
resetCPHeavyHitterspublic static void resetCPHeavyHitters() 
 - 
getCPHeavyHitterCodepublic static String getCPHeavyHitterCode(Instruction inst) 
 - 
addCPMemObjectpublic static void addCPMemObject(int hash, double sizeof)
 - 
removeCPMemObjectpublic static void removeCPMemObject(int hash) Helper method to remove a memory object which has become unpinned- Parameters:
- hash- hash of data object
 
 - 
maintainCPHeavyHittersMempublic 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 name
- sizeof- objects size (estimated bytes)
 
 - 
maintainCPHeavyHitterspublic 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/op
- timeNanos- time in nano seconds
 
 - 
maintainCPFuncCallStatspublic static void maintainCPFuncCallStats(String instName) 
 - 
getCPHeavyHitterCountpublic static long getCPHeavyHitterCount(String opcode) 
 - 
getHeavyHittersHashMappublic static HashMap<String,org.apache.commons.lang3.tuple.Pair<Long,Double>> getHeavyHittersHashMap() 
 - 
getHeavyHitterspublic 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
 
 - 
getCPHeavyHittersMempublic static String getCPHeavyHittersMem(int num) 
 - 
getJITCompileTimepublic static long getJITCompileTime() Returns the total time of asynchronous JIT compilation in milliseconds.- Returns:
- JIT compile time
 
 - 
getJVMgcTimepublic static long getJVMgcTime() 
 - 
getJVMgcCountpublic static long getJVMgcCount() 
 - 
getFunRecompileTimepublic static long getFunRecompileTime() 
 - 
getFunRecompilespublic static long getFunRecompiles() 
 - 
getNumPinnedObjectspublic static long getNumPinnedObjects() 
 - 
getSizeofPinnedObjectspublic static double getSizeofPinnedObjects() 
 - 
displaypublic static String display() Returns statistics of the DML program that was recently completed as a string- Returns:
- statistics as a string
 
 - 
displaypublic 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
 
 
- 
 
-