1 11 package org.eclipse.osgi.framework.stats; 12 13 import java.util.ArrayList ; 14 15 18 public class ClassStats { 19 private String className; private ClassloaderStats classloader; private int loadOrder = -1; 22 23 private long timestamp; private long timeLoading; private long timeLoadingOthers = 0; 27 private ClassStats loadedBy = null; private ArrayList loaded = new ArrayList (2); 31 private boolean duringStartup; 33 private long traceStart = -1; 35 private long traceEnd = -1; 36 37 public ClassStats(String name, ClassloaderStats classloader) { 38 className = name; 39 timestamp = System.currentTimeMillis(); 40 duringStartup = StatsManager.isBooting(); 41 this.classloader = classloader; 42 } 43 44 public void setLoadOrder(int order) { 45 loadOrder = order; 46 } 47 48 public void loadingDone() { 49 timeLoading = System.currentTimeMillis() - timestamp; 50 } 51 52 public long getTimeLoading() { 53 return timeLoading; 54 } 55 56 public long getLocalTimeLoading() { 57 return timeLoading - timeLoadingOthers; 58 } 59 60 public void addTimeLoadingOthers(long time) { 61 timeLoadingOthers = timeLoadingOthers + time; 62 } 63 64 public long getTraceStart() { 65 return traceStart; 66 } 67 68 public long getTraceEnd() { 69 return traceEnd; 70 } 71 72 public void setTraceStart(long position) { 73 traceStart = position; 74 } 75 76 public void setTraceEnd(long position) { 77 traceEnd = position; 78 } 79 80 public void loaded(ClassStats child) { 81 loaded.add(child); 82 } 83 84 public void setLoadedBy(ClassStats parent) { 85 loadedBy = parent; 86 } 87 88 public ClassStats getLoadedBy() { 89 return loadedBy; 90 } 91 92 public ArrayList getLoadedClasses() { 93 return loaded; 94 } 95 96 public String getClassName() { 97 return className; 98 } 99 100 public boolean isStartupClass() { 101 return duringStartup; 102 } 103 104 public ClassloaderStats getClassloader() { 105 return classloader; 106 } 107 108 public int getLoadOrder() { 109 return loadOrder; 110 } 111 112 public long getTimestamp() { 113 return timestamp; 114 } 115 116 public void toBaseClass() { 117 duringStartup = true; 118 loadOrder = -2; 119 } 120 } | Popular Tags |