code: protected String generateReport (String type, long now, boolean reset)
      {
          long sinceLast = now - _lastReportStamp;
          long uptime = now - _serverStartTime;
          StringBuilder report = new StringBuilder();
  
          // add standard bits to the default report
          if (DEFAULT_TYPE.equals(type)) {
              report.append("- Uptime: ");
              report.append(StringUtil.intervalToString(uptime)).append("\n");
              report.append("- Report period: ");
              report.append(StringUtil.intervalToString(sinceLast)).append("\n");
  
              // report on the state of memory
              Runtime rt = Runtime.getRuntime();
              long total = rt.totalMemory(), max = rt.maxMemory();
              long used = (total - rt.freeMemory());
              report.append("- Memory: ").append(used/1024).append("k used, ");
              report.append(total/1024).append("k total, ");
              report.append(max/1024).append("k max\n");
          }
  
          for (Reporter rptr : _reporters.get(type)) {
              try {
                  rptr.appendReport(report, now, sinceLast, reset);
              } catch (Throwable t) {
                  log.warning("Reporter choked", "rptr", rptr, t);
              }
          }
  
          /* The following Interval debug methods are no longer supported,
           * but they could be added back easily if needed.
          report.append("* samskivert.Interval:\n");
          report.append("- Registered intervals: ");
          report.append(Interval.registeredIntervalCount());
          report.append("\n- Fired since last report: ");
          report.append(Interval.getAndClearFiredIntervals());
          report.append("\n");
          */
  
          // strip off the final newline
          int blen = report.length();
          if (report.length() > 0 && report.charAt(blen-1) == '\n') {
              report.delete(blen-1, blen);
          }
  
          // only reset the last report time if this is a periodic report
          if (reset) {
              _lastReportStamp = now;
          }
  
          return report.toString();
      }
docs: Generates and logs a "state of server" report.