Exemple #1
0
 public Object[] getElements(Object input) {
   LongEnumer keys = xlogMap.keys();
   ArrayList<XLogConnection> list = new ArrayList<XLogConnection>();
   LongKeyMap<Integer> countMap = new LongKeyMap<Integer>();
   while (keys.hasMoreElements()) {
     long key = keys.nextLong();
     XLogData d = xlogMap.get(key);
     long caller = d.p.caller;
     Integer cntInt = countMap.get(caller);
     if (cntInt == null) {
       cntInt = new Integer(1);
       countMap.put(caller, cntInt);
     } else {
       cntInt = new Integer(cntInt.intValue() + 1);
       countMap.put(caller, cntInt);
     }
     XLogConnection conn = new XLogConnection(caller, d);
     String serviceName =
         TextProxy.service.getLoadText(DateUtil.yyyymmdd(d.p.endTime), d.p.service, d.serverId);
     conn.name =
         "("
             + cntInt.intValue()
             + ") "
             + serviceName.substring(serviceName.lastIndexOf("/"), serviceName.length());
     conn.elapsed = d.p.elapsed;
     conn.error = d.p.error != 0;
     list.add(conn);
   }
   return list.toArray();
 }
Exemple #2
0
 public Object getSource(Object obj) {
   if (obj instanceof XLogConnection) {
     long key = ((XLogConnection) obj).sourceId;
     if (key == 0) {
       XLogData d = ((XLogConnection) obj).destXlog;
       return new StartHome(IPUtil.toString(d.p.ipaddr));
     }
     return xlogMap.get(key);
   }
   return null;
 }