@Override
    public Integer getEventCount() {
        Connection con = null;
        PreparedStatement pstmt = null;
        ResultSet rs = null;
        Integer cnt = 0;
        try {
            con = DbConnectionManager.getConnection();
            pstmt = con.prepareStatement(GET_EVENT_COUNT);
            rs = pstmt.executeQuery();
            cnt = rs.getInt(1);
        }
        catch (Exception e) {
            // Hrm.  That should not occur.
            Log.error("Error while looking up number of security audit events: ", e);
        }
        finally {
            DbConnectionManager.closeConnection(rs, pstmt, con);
        }

        return cnt;
    }
The default provider counts the number of entries in the ofSecurityAuditLog table.
@see org.jivesoftware.openfire.security.SecurityAuditProvider#getEventCount()
xmppserver/src/main/java/org/jivesoftware/openfire/security/DefaultSecurityAuditProvider.java