/** * This gets the data from CWDataBrowserReset (if any is available) * * @return true if reset info was successfully retrieved */ public boolean getDataFromReset() { // is there no resetThread? if (resetThread == null) return false; // is the resetThread still running? if (resetThread.isAlive()) return false; // did the resetThread throw an exception? String2.log(cwDataBrowserReset.runInfo.toString()); if (cwDataBrowserReset.runError.length() > 0) { // error already printed to Tomcat's log // there is nothing more to be done // keep using old data // send email to Bob Simons? cwDataBrowserReset = null; resetThread = null; return false; } // store dataSet info activeDataSetOptions = cwDataBrowserReset.activeDataSetOptions; activeDataSetTitles = cwDataBrowserReset.activeDataSetTitles; activeDataSetContents = cwDataBrowserReset.activeDataSetContents; dataSet.setOptions(activeDataSetOptions); // 1 time only; doesn't change till next reset() dataSet.setTitles(activeDataSetTitles); // 1 time only; doesn't change till next reset() if (verbose) String2.log("activeDataSetTitles: " + String2.toNewlineString(activeDataSetTitles)); // print lots of useful information String2.log( "\n" + String2.makeString('*', 80) + "\nCWDataBrowser.getDataFromReset " + Calendar2.getCurrentISODateTimeStringLocal()); String2.log("CWDataBrowser construction was at " + constructorDateTime + ". Since then...\n"); String2.log("Data files found which have matching .gif files:"); String2.log(getUsageStatistics()); String2.log(" number of page requests initiated since construction: " + nRequestsInitiated); String2.log(" number of page requests completed since construction: " + nRequestsCompleted); if (nRequestsInitiated > 0) { DecimalFormat percent = new DecimalFormat("##0.000"); double nRequests = nRequestsInitiated / 100.0; String2.log("Data Set Usage:"); for (int i = 0; i < dataSetOptions.length; i++) String2.log( String2.right(percent.format(dataSetRequests[i] / nRequests), 9) + "% were for " + dataSetOptions[i]); String2.log("Time Period Usage:"); for (int i = 0; i < timePeriodOptions.length; i++) String2.log( String2.right(percent.format(timePeriodRequests[i] / nRequests), 9) + "% were for " + timePeriodOptions[i]); String2.log("Region Usage:"); for (int i = 0; i < regionOptions.length; i++) String2.log( String2.right(percent.format(regionRequests[i] / nRequests), 9) + "% were for " + regionOptions[i]); } String2.log( SSR.getTopN(printTopNMostRequested, " Most Requested .gif files", requestedFilesMap)); // data was successfully gathered from CWDataBrowserReset resetThread = null; cwDataBrowserReset = null; return true; }