package com.atlassian.stash.internal.concurrent;

/**
 * Provides information about {@link com.atlassian.beehive.ClusterLock} usage for JMX
 *
 * @since 4.8
 */
public interface ClusterLockMXBean {

    /**
     * @return the number of cluster locks that are currently held by this node
     */
    long getLockedCount();

    /**
     * @return the number of threads on this node that are currently blocked waiting for a lock
     */
    int getQueuedThreadCount();

    /**
     * @return the total number of times a cluster lock was acquired on this node since startup
     */
    long getTotalAcquiredCount();

    /**
     * @return the number of times an exception was thrown while trying to acquire a cluster lock on this node
     *         since startup
     */
    long getTotalAcquireErrorCount();

    /**
     * @return the total time in milliseconds that any thread on this node has spent acquiring a lock (including time
     *         blocked waiting for a lock to become available)
     */
    long getTotalAcquireTimeMillis();

    /**
     * @return the total number of times a cluster lock was released on this node since startup
     */
    long getTotalReleasedCount();

    /**
     * @return the total number of times an exception was thrown while releasing a cluster lock on this node
     *         since startup
     */
    long getTotalReleaseErrorCount();
}
