You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "rajesh.rai@ing.com" <ra...@ing.com> on 2018/02/22 14:02:46 UTC

get metrics from ignite-cassandra session

Hi there,

is there a way if i can get metrics out of ignite-cassandra session? i tried
doing so by using a SessionListener in my cache configuration with below
implementation,

import com.datastax.driver.core.Session; import
org.apache.ignite.IgniteLogger; import
org.apache.ignite.cache.store.CacheStoreSession;
import org.apache.ignite.cache.store.CacheStoreSessionListener;
import org.apache.ignite.cache.store.cassandra.session.CassandraSessionImpl;
import org.apache.ignite.cache.store.cassandra.session.pool.SessionPool;
import org.apache.ignite.resources.LoggerResource;

public class IngCassandraMetricsPublisher implements
CacheStoreSessionListener {

    @LoggerResource
    IgniteLogger log;

    @Override
    public void onSessionStart(CacheStoreSession ses) {

    }

    @Override
    public void onSessionEnd(CacheStoreSession ses, boolean commit) {
        Session cassandra_store_connection =
SessionPool.get((CassandraSessionImpl)
ses.properties().get("CASSANDRA_STORE_CONNECTION"));
        com.datastax.driver.core.Metrics metrics =
cassandra_store_connection.getCluster().getMetrics();
        log.info("metrics client timeouts:" +
metrics.getErrorMetrics().getClientTimeouts().getCount());
    }
}


but this gives me null pointer exceptions as ses.properties() returns 0
count. I tried using DataSource to get CassandraSession But I am stuck at
point where i need to extract "*com.datastax.driver.core.Session*". Could
any one help?

regards,
Rajesh




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: get metrics from ignite-cassandra session

Posted by vkulichenko <va...@gmail.com>.
Rajesh,

Cassandra session is already released to the poll when onSessionEnd is
called. I don't think there is currently a way to acquire this information.
Here is a ticket for improvement:
https://issues.apache.org/jira/browse/IGNITE-7798

-Val



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/