Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

Are there any examples of using the StatisticsAdmin interface?

I am looking, as part of our application admin web app, to have some statistics from the space (e.g., number of takes, objects in the space, outstanding transactions, etc.). Just some basic stuff linked into our own UI, for more advanced usage head to the GS UI. I can not determine where to get some of the more useful data via the API docs.

Thanks!

Mike

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2390]{quote}

asked 2008-06-18 12:19:49 -0500

mcnoche gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

5 Answers

Sort by ยป oldest newest most voted
0

BEFORE filter codes means that this filter will be called before that operation.
For instance, BEFORE update means the filter will be called before the update operation is executed and AFTER update means the filter will be called after the update operation was done.

stats.getStatistics(new Integer(FilterOperationCodes.BEFORE_UPDATE));

Will return the statistics relevant to the before update operation

Eitan.

answered 2008-06-20 06:23:03 -0500

eitany gravatar image
edit flag offensive delete link more
0

Thanks for the links. Can you explain to me the FilterOperationCodes? The JavaDoc does not really say what these mean. For example:

StatisticsContext updateStat = stats.getStatistics(new Integer(FilterOperationCodes.BEFORE_UPDATE));

What does the BEFORE_UPDATE and AFTER_UPDATE counts mean?

answered 2008-06-19 13:17:39 -0500

mcnoche gravatar image
edit flag offensive delete link more

Comments

The wiki includes the space filter page with all the info u need.

Shay

shay hassidim gravatar imageshay hassidim ( 2008-06-20 06:32:49 -0500 )edit
0

Shay,

Thank you so much...all is clear to me now!

Mike

answered 2008-06-24 09:12:29 -0500

mcnoche gravatar image
edit flag offensive delete link more
0

Thanks for the replies and helpful information.

I am sorry for being a bit dense but I am just having a hard time understanding what the following calls are doing differently:

System.out.println( "BEFORE_WRITE: " + stats.getStatistics( new Integer( FilterOperationCodes.BEFORE_WRITE ) ) ); System.out.println( "AFTER_WRITE: " + stats.getStatistics( new Integer( FilterOperationCodes.AFTER_WRITE ) ) );

and the output is:

BEFORE_WRITE: count: 1606936, average time (op/ms): 0.0 AFTER_WRITE: null

Also, is there a way to get the list of currently active/open transactions in the system?

TIA,

Mike

answered 2008-06-23 08:45:25 -0500

mcnoche gravatar image
edit flag offensive delete link more

Comments

The JSpaceStatistics monitoring the following operations: 0, 2, 3, 4, 7, 8, 9, 12, 14, 15, 16, 52

The AFTER_WRITE (operation code 1) is not monitored by default. That's why AFTER_WRITE value is null.

If you want the AFTER_WRITE to be monitored add 1 to the list of monitored operations.

Getting the current transactions can be done using the com.j_spaces.core.client.TransactionInfo. See below:

import net.jini.core.transaction.server.TransactionConstants; import com.j_spaces.core.IJSpace; import com.j_spaces.core.admin.IInternalRemoteJSpaceAdmin; import com.j_spaces.core.client.SpaceFinder; import com.j_spaces.core.client.TransactionInfo;

    TransactionInfo[] transactionInfoArray = null;

    try {
        IJSpace space = (IJSpace) SpaceFinder
                .find("jini://*/*/mySpace");
        IInternalRemoteJSpaceAdmin admin = (IInternalRemoteJSpaceAdmin) space.getAdmin();
            System.out.println("           TX List");
            System.out.println(" ----------------------------");
            transactionInfoArray = admin.getTransactionsInfo(
                    TransactionInfo.Types.ALL, TransactionConstants.ACTIVE);
            for (int i = 0; i < transactionInfoArray.length; i++) {
                System.out.println(" TX ID:"
                        + transactionInfoArray[i].getTxnId()
                        + " NumberOfLockedObjects:"
                        + transactionInfoArray[i]
                                .getNumberOfLockedObjects() + " StartTime:"
                        + transactionInfoArray[i].getStartTime()
                        + " Status:" + transactionInfoArray[i].getStatus()
                        + " Type:" + transactionInfoArray[i].getType());
            }

Shay

Edited by: Shay Hassidim on Jun 23, 2008 4:04 PM

shay hassidim gravatar imageshay hassidim ( 2008-06-23 15:59:05 -0500 )edit
0

Hi Mike,

You can use the space admin API to read raw space stats. See http://www.gigaspaces.com/wiki/displa...

You can also use the JMX API to gather JVM stats etc'. See http://www.gigaspaces.com/wiki/displa...

-Guy

answered 2008-06-18 12:33:24 -0500

guy sayar gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2008-06-18 12:19:49 -0500

Seen: 61 times

Last updated: Jun 24 '08