/**
   * Get Mondrian Stats
   *
   * @summary Get Mondrian stats
   * @return A selection of Mondrian stats.
   */
  @GET
  @Produces({"application/json"})
  @Path("/mondrian")
  public MondrianStats getMondrianStats() {

    MondrianServer mondrianServer = MondrianServer.forId(null);
    if (mondrianServer != null) {
      MondrianVersion mv = mondrianServer.getVersion();

      final Monitor monitor = mondrianServer.getMonitor();
      final ServerInfo server = monitor.getServer();

      int statementCurrentlyOpenCount = 0; // server.statementCurrentlyOpenCount();
      int connectionCurrentlyOpenCount = 0; // server.connectionCurrentlyOpenCount();
      int sqlStatementCurrentlyOpenCount = 0; // server.sqlStatementCurrentlyOpenCount();
      int statementCurrentlyExecutingCount = 0; // server.statementCurrentlyExecutingCount();
      float avgCellDimensionality = ((float) server.cellCoordinateCount / (float) server.cellCount);

      final List<ConnectionInfo> connections = monitor.getConnections();
      final List<StatementInfo> statements = monitor.getStatements();

      return new MondrianStats(
          server,
          mv,
          statementCurrentlyOpenCount,
          connectionCurrentlyOpenCount,
          sqlStatementCurrentlyOpenCount,
          statementCurrentlyExecutingCount,
          avgCellDimensionality,
          connections,
          statements);
    }

    return null;
  }
  /**
   * Get Mondrian Server Info
   *
   * @summary Get Mondrian Info
   * @return Server Info
   */
  @GET
  @Produces({"application/json"})
  @Path("/mondrian/server")
  public ServerInfo getMondrianServer() {
    MondrianServer mondrianServer = MondrianServer.forId(null);
    if (mondrianServer != null) {
      MondrianVersion mv = mondrianServer.getVersion();

      final Monitor monitor = mondrianServer.getMonitor();
      final ServerInfo server = monitor.getServer();
      return server;
    }
    return null;
  }