Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSMutableDictionary.allValues()


  public static void logStatisticsForOperation(Logger statsLog, String operation) {
    if(statsLog.isDebugEnabled()) {
      NSMutableDictionary statistics = ERXStats.statistics();
      if (statistics != null) {
        synchronized (statistics) {
          NSArray values = ERXArrayUtilities.sortedArraySortedWithKey(statistics.allValues(), operation);
          if (values.count() > 0) {
            Long startTime = (Long) ERXThreadStorage.valueForKey(ERXStats.STATS_START_TIME_KEY);
            Long lastTime = (Long) ERXThreadStorage.valueForKey(ERXStats.STATS_LAST_TIME_KEY);
            long currentTime = System.currentTimeMillis();
            String result = NSPropertyListSerialization.stringFromPropertyList(values);
View Full Code Here


            // result = result.replaceAll("\\n\\t", "\n\t\t");
            // result = result.replaceAll("\\n", "\n\t\t");
            statsLog.debug(
                (startTime != null ? "Time since init " + (currentTime - startTime.longValue()) + " ms": "" ) +
                (lastTime != null ? ", last log " + (currentTime - lastTime.longValue()) + " ms": "" ) +
                ", total cnt/sum: " + statistics.allValues().valueForKeyPath("@sum.count") + "/" + statistics.allValues().valueForKeyPath("@sum.sum") +
                " (cnt/sum : min/max/avg|trace cnt -> key) = " + result);
            ERXThreadStorage.takeValueForKey(Long.valueOf(currentTime), ERXStats.STATS_LAST_TIME_KEY);
          }
        }
      }
View Full Code Here

            // result = result.replaceAll("\\n\\t", "\n\t\t");
            // result = result.replaceAll("\\n", "\n\t\t");
            statsLog.debug(
                (startTime != null ? "Time since init " + (currentTime - startTime.longValue()) + " ms": "" ) +
                (lastTime != null ? ", last log " + (currentTime - lastTime.longValue()) + " ms": "" ) +
                ", total cnt/sum: " + statistics.allValues().valueForKeyPath("@sum.count") + "/" + statistics.allValues().valueForKeyPath("@sum.sum") +
                " (cnt/sum : min/max/avg|trace cnt -> key) = " + result);
            ERXThreadStorage.takeValueForKey(Long.valueOf(currentTime), ERXStats.STATS_LAST_TIME_KEY);
          }
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.