/** * INTERNAL: * Create root noun for TopLink dms metrics. */ protected void createRootNoun() { root = Noun.create(EclipseLinkRootNoun); }
/** * INTERNAL: * Initialize TopLink noun tree by default (DMSConsole.getSensorWeight()) */ public void initialize() { weight = DMSConsole.NONE; initializeNounTree(DMSConsole.getSensorWeight()); weight = DMSConsole.getSensorWeight(); }
/** * INTERNAL: * Link to the dms Event api occurred(). */ public void occurred(String operationName, AbstractSession session) { Sensor event = getSensorByName(operationName); if (event != null) { ((Event)event).occurred(); } }
PhaseEvent mergeTime = PhaseEvent.create(baseTransactionNoun, MergeTime, DMSLocalization.buildMessage("merge_time")); mergeTime.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.Merge, mergeTime); PhaseEvent jtsAferCompletion = PhaseEvent.create(baseTransactionNoun, SessionProfiler.JtsAfterCompletion, DMSLocalization.buildMessage("jts_aftercompletion")); jtsAferCompletion.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.JtsAfterCompletion, jtsAferCompletion); PhaseEvent jtsBeforeCompletion = PhaseEvent.create(baseTransactionNoun, SessionProfiler.JtsBeforeCompletion, DMSLocalization.buildMessage("jts_beforecompletion")); jtsBeforeCompletion.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.JtsBeforeCompletion, jtsBeforeCompletion); PhaseEvent uowRegister = PhaseEvent.create(baseTransactionNoun, UnitOfWorkRegister, DMSLocalization.buildMessage("unitofwork_register")); uowRegister.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.Register, uowRegister); PhaseEvent distributedMerge = PhaseEvent.create(baseTransactionNoun, DistributedMergeDmsDisplayName, DMSLocalization.buildMessage("distributed_merge")); distributedMerge.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.DistributedMerge, distributedMerge); PhaseEvent sequence = PhaseEvent.create(baseTransactionNoun, Sequencing, DMSLocalization.buildMessage("assigning_sequence_numbers")); sequence.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.AssignSequence, sequence); PhaseEvent cache = PhaseEvent.create(baseCacheNoun, SessionProfiler.Caching, DMSLocalization.buildMessage("caching")); cache.deriveMetric(Sensor.all); this.getAllWeightSensors().put(CACHE, cache); PhaseEvent dbConnect = PhaseEvent.create(baseConnectionNoun, SessionProfiler.ConnectionManagement, DMSLocalization.buildMessage("connection"));
/** * INTERNAL: * Build dms NORMAL weight sensors for TopLink dms metrics. */ protected void initializeNormalWeightSensors() { createRootNoun(); Noun sessionNoun = Noun.create(root, "Session" + getSessionName(), SessionNounType); //SessionName State.create(sessionNoun, SessionProfiler.SessionName, "", DMSLocalization.buildMessage("session_name"), (this.getSession().getName() == "") ? "session name not specified" : getSession().getName()); //LoginTime State sessionLoginTime = State.create(sessionNoun, SessionProfiler.LoginTime, "", DMSLocalization.buildMessage("session_login_time"), "not available"); this.getNormalWeightSensors().put(SessionProfiler.LoginTime, sessionLoginTime); this.getNormalWeightNouns().put(SessionNounType, sessionNoun); }
/** * INTERNAL: * Link to the dms State api update(). */ public void update(String operationName, Object value) { Sensor state = getSensorByName(operationName); if (state != null) { ((State)state).update(value); } }
/** * INTERNAL: * Link to the dms PhaseEvent api stop(). */ public void endOperationProfile(String operationName) { //due to DMS bug3242994 can't set DMS weight to NONE //shortcut for NORMAL weight since no operation profiles are every done for this level. if (getProfileWeight() == DMSConsole.NORMAL) { return; } Sensor phaseEvent = getSensorByName(operationName); if (phaseEvent != null) { Long startTime = (Long)getPhaseEventStartToken().get(operationName); ((PhaseEvent)phaseEvent).stop(startTime.longValue()); } }
/** * INTERNAL: * Link to the dms PhaseEvent api start(). */ public void startOperationProfile(String operationName) { //due to DMS bug3242994 can't set DMS weight to NONE //shortcut for NORMAL weight since no operation profiles are every done for this level. if (getProfileWeight() == DMSConsole.NORMAL) { return; } Sensor phaseEvent = getSensorByName(operationName); if (phaseEvent != null) { Long startToken = new Long(((PhaseEvent)phaseEvent).start()); getPhaseEventStartToken().put(operationName, startToken); } }
PhaseEvent mergeTime = PhaseEvent.create(baseTransactionNoun, MergeTime, DMSLocalization.buildMessage("merge_time")); mergeTime.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.Merge, mergeTime); PhaseEvent jtsAferCompletion = PhaseEvent.create(baseTransactionNoun, SessionProfiler.JtsAfterCompletion, DMSLocalization.buildMessage("jts_aftercompletion")); jtsAferCompletion.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.JtsAfterCompletion, jtsAferCompletion); PhaseEvent jtsBeforeCompletion = PhaseEvent.create(baseTransactionNoun, SessionProfiler.JtsBeforeCompletion, DMSLocalization.buildMessage("jts_beforecompletion")); jtsBeforeCompletion.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.JtsBeforeCompletion, jtsBeforeCompletion); PhaseEvent uowRegister = PhaseEvent.create(baseTransactionNoun, UnitOfWorkRegister, DMSLocalization.buildMessage("unitofwork_register")); uowRegister.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.Register, uowRegister); PhaseEvent distributedMerge = PhaseEvent.create(baseTransactionNoun, DistributedMergeDmsDisplayName, DMSLocalization.buildMessage("distributed_merge")); distributedMerge.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.DistributedMerge, distributedMerge); PhaseEvent sequence = PhaseEvent.create(baseTransactionNoun, Sequencing, DMSLocalization.buildMessage("assigning_sequence_numbers")); sequence.deriveMetric(Sensor.all); this.getAllWeightSensors().put(SessionProfiler.AssignSequence, sequence); PhaseEvent cache = PhaseEvent.create(baseCacheNoun, SessionProfiler.Caching, DMSLocalization.buildMessage("caching")); cache.deriveMetric(Sensor.all); this.getAllWeightSensors().put(CACHE, cache); PhaseEvent dbConnect = PhaseEvent.create(baseConnectionNoun, SessionProfiler.ConnectionManagement, DMSLocalization.buildMessage("connection"));
/** * INTERNAL: * Build dms NORMAL weight sensors for TopLink dms metrics. */ protected void initializeNormalWeightSensors() { createRootNoun(); Noun sessionNoun = Noun.create(root, "Session" + getSessionName(), SessionNounType); //SessionName State.create(sessionNoun, SessionProfiler.SessionName, "", DMSLocalization.buildMessage("session_name"), (this.getSession().getName() == "") ? "session name not specified" : getSession().getName()); //LoginTime State sessionLoginTime = State.create(sessionNoun, SessionProfiler.LoginTime, "", DMSLocalization.buildMessage("session_login_time"), "not available"); this.getNormalWeightSensors().put(SessionProfiler.LoginTime, sessionLoginTime); this.getNormalWeightNouns().put(SessionNounType, sessionNoun); }
/** * INTERNAL: * Create root noun for TopLink dms metrics. */ protected void createRootNoun() { root = Noun.create(EclipseLinkRootNoun); }
/** * INTERNAL: * Link to the dms Event api occurred(). */ public void occurred(String operationName, AbstractSession session) { Sensor event = getSensorByName(operationName); if (event != null) { ((Event)event).occurred(); } }
/** * INTERNAL: * Link to the dms State api update(). */ public void update(String operationName, Object value) { Sensor state = getSensorByName(operationName); if (state != null) { ((State)state).update(value); } }
/** * INTERNAL: * Initialize TopLink noun tree by default (DMSConsole.getSensorWeight()) */ public void initialize() { weight = DMSConsole.NONE; initializeNounTree(DMSConsole.getSensorWeight()); weight = DMSConsole.getSensorWeight(); }
/** * INTERNAL: * Link to the dms PhaseEvent api stop(). */ public void endOperationProfile(String operationName) { //due to DMS bug3242994 can't set DMS weight to NONE //shortcut for NORMAL weight since no operation profiles are every done for this level. if (getProfileWeight() == DMSConsole.NORMAL) { return; } Sensor phaseEvent = getSensorByName(operationName); if (phaseEvent != null) { Long startTime = (Long)getPhaseEventStartToken().get(operationName); ((PhaseEvent)phaseEvent).stop(startTime.longValue()); } }
/** * INTERNAL: * Link to the dms PhaseEvent api start(). */ public void startOperationProfile(String operationName) { //due to DMS bug3242994 can't set DMS weight to NONE //shortcut for NORMAL weight since no operation profiles are every done for this level. if (getProfileWeight() == DMSConsole.NORMAL) { return; } Sensor phaseEvent = getSensorByName(operationName); if (phaseEvent != null) { Long startToken = new Long(((PhaseEvent)phaseEvent).start()); getPhaseEventStartToken().put(operationName, startToken); } }
/** * INTERNAL: * Look for noun based on the given type and weight. If not found and the parent noun is not null, create a new noun. */ protected Noun getNounByType(String type, Noun parentNoun, int weight) { if (getProfileWeight() < weight) { return null; } Noun noun = null; Map map = null; if (weight == DMSConsole.NORMAL) { map = getNormalWeightNouns(); } else if (weight == DMSConsole.HEAVY) { map = getHeavyWeightNouns(); } else if (weight == DMSConsole.ALL) { map = getAllWeightNouns(); } if (map != null) { noun = (Noun)map.get(type); if (noun == null) { if (parentNoun != null) { noun = Noun.create(parentNoun, type, type); map.put(type, noun); } } } return noun; }
/** * INTERNAL: * Increase DMS Event sensor occurrence.(DMS) */ public void occurred(String operationName, DatabaseQuery query, AbstractSession session) { Sensor event = getSensorByName(operationName); if (event != null) { ((Event)event).occurred(); occurred(query.getMonitorName(), session); } }
/** * INTERNAL: * Look for noun based on the given type and weight. If not found and the parent noun is not null, create a new noun. */ protected Noun getNounByType(String type, Noun parentNoun, int weight) { if (getProfileWeight() < weight) { return null; } Noun noun = null; Map map = null; if (weight == DMSConsole.NORMAL) { map = getNormalWeightNouns(); } else if (weight == DMSConsole.HEAVY) { map = getHeavyWeightNouns(); } else if (weight == DMSConsole.ALL) { map = getAllWeightNouns(); } if (map != null) { noun = (Noun)map.get(type); if (noun == null) { if (parentNoun != null) { noun = Noun.create(parentNoun, type, type); map.put(type, noun); } } } return noun; }
/** * INTERNAL: * Increase DMS Event sensor occurrence.(DMS) */ public void occurred(String operationName, DatabaseQuery query, AbstractSession session) { Sensor event = getSensorByName(operationName); if (event != null) { ((Event)event).occurred(); occurred(query.getMonitorName(), session); } }