public AttributeHolder set(final String key, final float value) { return attributes.set(key, value).serializable(); }
private void fireMonitoringGapEvent(TransactionMonitor tMon, TransactionMonitor leftChild, TransactionMonitor rightChild, long latency) { EventMonitor eventMonitor = new EventMonitor("MonitoringCoverageGap"); eventMonitor.set("monitorName", tMon.get(Attribute.NAME)); eventMonitor.set("leftChild", leftChild == null ? null : leftChild.get(Attribute.NAME)); eventMonitor.set("rightChild", rightChild == null ? null : rightChild.get(Attribute.NAME)); eventMonitor.set(Attribute.LATENCY, latency); eventMonitor.fire(); }
/** * Sets a global attribute with an int value. Global attributes will be set on all monitors during * the initMonitor() call. * * @param key the attribute to set * @param value the value of that attribute */ public void setGlobalAttribute(final String key, final int value) { globalAttributes.set(key, value); }
/** * Marks this transaction as having failed due to the supplied Throwable. * * @param e the Throwable that caused the failure */ public void failedDueTo(Throwable e) { set(Attribute.FAILURE_THROWABLE, e).serializable(); failed(); }
@Override Serializable createMutableContainer(final Object object) { AttributeHolder holder = (AttributeHolder)object; return new AttributeHolder(holder.getValue()); }
/** * Sets a global attribute with a map of values. Global attributes will be set on all monitors * during the initMonitor() call. * * @param attributes the map of attributes to set */ public void setGlobalAttributes(final Map attributes) { globalAttributes.setAll(attributes); }
/** * Initializes the attribute map and global attributes. Subclasses will need to call init(String) * themselves. */ protected AbstractMonitor() { attributes = createAttributeMap(); processed = false; }
/** * Fire this value monitor. Delegates to AbstractMonitor.process(). */ public void fire() { process(); } }
/** * Creates a new {@link AttributeMap} * @return a new attribute map */ protected AttributeMap createAttributeMap() { return new AttributeMap(); }
public boolean apply(final CompositeAttributeHolder holder) { return holder.isInheritable(); } });
public <V> Map<String, V> getAll() { Map<String, V> result = attributes.getAll(); return result; }
/** * Creates a new transaction monitor with the provided * name and monitoring level. The monitor is marked as * failed by default. Also, the start time of this * transaction is noted, thereby starting the stop watch. * * @param name the name of the monitor * @param monitoringLevel the monitoring level */ public TransactionMonitor(String name, MonitoringLevel monitoringLevel) { super(name, monitoringLevel); startTransactionMonitor(); }
public AttributeHolder set(final String key, final char value) { return attributes.set(key, value).serializable(); }
/** * Sets a global attribute with an Object value. Global attributes will be set on all monitors * during the initMonitor() call. * * @param key the attribute to set * @param value the value of that attribute */ public void setGlobalAttribute(final String key, final Object value) { globalAttributes.set(key, value); }
/** * Creates an attribute map with a pre-filled set of attributes. Attributes will be copied from * the specified attributeMap. * @param attributeMap the initial values. Ignored if null. */ public AttributeMap(final Map<String, Object> attributeMap) { this(); if (attributeMap != null) { setAll(attributeMap); } }
public AttributeHolder set(String key, double value) { return _attributes.set(key, value).serializable(); }
/** * Sets a global attribute with a char value. Global attributes will be set on all monitors during * the initMonitor() call. * * @param key the attribute to set * @param value the value of that attribute */ public void setGlobalAttribute(final String key, final char value) { globalAttributes.set(key, value); }
public AttributeHolder set(String key, byte value) { return _attributes.set(key, value).serializable(); }
public AttributeHolder set(final String key, final short value) { return attributes.set(key, value).serializable(); }
public AttributeHolder set(final String key, final double value) { return attributes.set(key, value).serializable(); }