long took = (System.nanoTime() - start) / (1000 * 1000); double rate = (took > 0) ? ((double) count / took) : 0.0; parseInfo.format("nmsgs= %d nobs = %d took %d msecs rate = %f msgs/msec\n", count, scan.getTotalObs(), took, rate);
static void scanMixedMessageTypes(String filename) throws IOException { //RandomAccessFile raf = new RandomAccessFile("C:\\data\\bufr\\edition3\\idd\\radiosonde\\SoundingVerticalRadiosonde4.bufr", "r"); try (RandomAccessFile raf = new RandomAccessFile(filename, "r")) { out.format("%n-----%nOpen %s size = %d Kb %n", raf.getLocation(), raf.length() / 1000); MessageScanner scan = new MessageScanner(raf); int count = 0; while (scan.hasNext()) { Message m = scan.next(); if (m == null) continue; List<String> desc = m.dds.getDescriptors(); String key = mixedSet.get(desc); if (null == key) { out.format(" new Message Type msg=%d <%s> ndesc=%d hashCode=%d%n", count, m.getHeader(), desc.size(), desc.hashCode()); m.getRootDataDescriptor(); m.dump(out); mixedSet.put(desc, filename); } else if (!key.equals(filename)) { out.format(" msg type from file= %s, hashcode=%d%n", key, desc.hashCode()); } count++; } out.format("nmsgs= %d nobs = %d%n", count, scan.getTotalObs()); } }
out.format(filename + " total_msgs= %d good=%d total_obs = %d%n", scan.getTotalMessages(), count, scan.getTotalObs()); total_msgs += scan.getTotalMessages(); good_msgs += count; total_obs += scan.getTotalObs();
out.format(" nmsgs= %d nobs = %d took %d msecs rate = %f msgs/msec%n", count, scan.getTotalObs(), took / (1000 * 1000), rate); return scan.getTotalObs();
out.format("nmsgs= %d nobs = %d%n", count, scan.getTotalObs());
total_obs += scan.getTotalObs();
out.format("total_msgs= %d good=%d total_obs = %d%n", scan.getTotalMessages(), count, scan.getTotalObs()); total_msgs += scan.getTotalMessages(); good_msgs += count; total_obs += scan.getTotalObs();