Example #1
0
 /**
  * Recursively locate AlarmPVs in alarm hierarchy
  *
  * @param node Start node
  * @param pvs Array to which located AlarmPVs are added
  */
 private void findPVs(final TreeItem node, final List<AlarmPV> pvs) {
   if (node instanceof AlarmPV) {
     pvs.add((AlarmPV) node);
     return;
   }
   for (int i = 0; i < node.getChildCount(); ++i) findPVs(node.getChild(i), pvs);
 }
Example #2
0
  /** Dump all PVs to stdout */
  public void dump() {
    System.out.println("== Alarm Server PV Snapshot ==");
    synchronized (this) {
      alarm_tree.dump(System.out);
    }

    System.out.println("Work queue size: " + work_queue.size());

    // Log memory usage in MB
    final double free = Runtime.getRuntime().freeMemory() / (1024.0 * 1024.0);
    final double total = Runtime.getRuntime().totalMemory() / (1024.0 * 1024.0);
    final double max = Runtime.getRuntime().maxMemory() / (1024.0 * 1024.0);

    final DateFormat format = new SimpleDateFormat(JMSLogMessage.DATE_FORMAT);
    System.out.format(
        "%s == Alarm Server Memory: Max %.2f MB, Free %.2f MB (%.1f %%), total %.2f MB (%.1f %%)\n",
        format.format(new Date()), max, free, 100.0 * free / max, total, 100.0 * total / max);
  }