All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.cassandra.metrics.AuthMetrics Maven / Gradle / Ivy

Go to download

The Apache Cassandra Project develops a highly scalable second-generation distributed database, bringing together Dynamo's fully distributed design and Bigtable's ColumnFamily-based data model.

There is a newer version: 5.0.0
Show newest version
package org.apache.cassandra.metrics;

import com.codahale.metrics.Meter;

/**
 * Metrics about authentication
 */
public class AuthMetrics
{

    public static final AuthMetrics instance = new AuthMetrics();

    public static void init()
    {
        // no-op, just used to force instance creation
    }

    /** Number and rate of successful logins */
    protected final Meter success;

    /** Number and rate of login failures */
    protected final Meter failure;

    private AuthMetrics()
    {

        success = ClientMetrics.instance.addMeter("AuthSuccess");
        failure = ClientMetrics.instance.addMeter("AuthFailure");
    }

    public void markSuccess()
    {
        success.mark();
    }

    public void markFailure()
    {
        failure.mark();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy