001: /*
002: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
003: */
004: package com.tc.management.beans.tx;
005:
006: import java.util.Map;
007:
008: import javax.management.openmbean.OpenDataException;
009: import javax.management.openmbean.TabularData;
010:
011: import com.tc.management.TerracottaMBean;
012:
013: /**
014: * MBean for monitoring transactions and objects in a particular L1 client.
015: */
016: public interface ClientTxMonitorMBean extends TerracottaMBean {
017:
018: /**
019: * The total number of read transactions in this L1 client.
020: * @return the total number of read transactions
021: */
022: int getReadTransactionCount();
023:
024: /**
025: * The read transaction rate in this client
026: * @return Read transacion rate
027: */
028: int getReadTransactionRatePerSecond();
029:
030: /**
031: * The total number of write transactions in this L1 client.
032: * @return the total number of write transactions
033: */
034: int getWriteTransactionCount();
035:
036: /**
037: * The write transaction rate in this client
038: * @return Write transacion rate
039: */
040: int getWriteTransactionRatePerSecond();
041:
042: /**
043: * Get the smallest number of writes in a write transaction
044: * @return Min writes per write txn
045: */
046: int getMinWritesPerWriteTransaction();
047:
048: /**
049: * Get the biggest number of writes in a write transaction
050: * @return Max writes per write txn
051: */
052: int getMaxWritesPerWriteTransaction();
053:
054: /**
055: * Get most objects modified in a transaction
056: * @return Max modified objects per txn
057: */
058: int getMaxModifiedObjectsPerTransaction();
059:
060: /**
061: * Get average number of objects modified in a transaction
062: * @return Avg modified objects per txn
063: */
064: int getAvgModifiedObjectsPerTransaction();
065:
066: /**
067: * Get object modification rate
068: * @return Object modification rate
069: */
070: int getObjectModificationRatePerSecond();
071:
072: /**
073: * Get max new objects per transaction
074: * @return Max new objects per txn
075: */
076: int getMaxNewObjectsPerTransaction();
077:
078: /**
079: * Get average number of new objects per transaction
080: * @return Avg new objects per txn
081: */
082: int getAvgNewObjectsPerTransaction();
083:
084: /**
085: * Get object creation rate
086: * @return Object creation rate
087: */
088: int getObjectCreationRatePerSecond();
089:
090: /**
091: * Get max notifications per transaction
092: * @return Max notifications per txn
093: */
094: int getMaxNotificationsPerTransaction();
095:
096: /**
097: * Get avg notifications per transaction
098: * @return Average notifications per txn
099: */
100: int getAvgNotificationsPerTransaction();
101:
102: /**
103: * Get max writes per object
104: * @return Max writes per object
105: */
106: int getMaxWritesPerObject();
107:
108: /**
109: * Get average writes per object
110: * @return Average writes per object
111: */
112: int getAvgWritesPerObject();
113:
114: /**
115: * Get objection creation by class
116: * @return Table of create count per class
117: * @throws OpenDataException Thrown when an open data instance can't be constructed due to validity errors
118: */
119: TabularData getObjectCreationCountByClass()
120: throws OpenDataException;
121:
122: /**
123: * Reset sampling
124: */
125: void reset();
126:
127: /**
128: * Event for a committed read transaction
129: */
130: void committedReadTransaction();
131:
132: /**
133: * Event for a committed write transaction
134: * @param notifyCount the number of {@link Object#notify()} invocations for this transaction
135: * @param modifiedObjectCount the total number of objects that were modified (NOT including creations)
136: * @param writeCountPerObject an array of individual write counts for each object in the transaction
137: * @param newObjectCountByClass a {@link Map}[{@link Class}, {@link Integer}] of all new objects created
138: */
139: void committedWriteTransaction(final int notifyCount,
140: final int modifiedObjectCount,
141: final int[] writeCountPerObject,
142: final Map newObjectCountByClass);
143:
144: }
|