public static synchronized RestcommStatsReporter getRestcommStatsReporter() { if (restcommStatsReporter == null) { restcommStatsReporter = new RestcommStatsReporter( filter, rateUnit, durationUnit, clock); } return restcommStatsReporter; }
statsReporter = new RestcommStatsReporter();
public void raActive() { if (statsReporter == null) { statsReporter = new RestcommStatsReporter(); } String statisticsServer = Version.getVersionProperty(STATISTICS_SERVER); if (statisticsServer == null || !statisticsServer.contains("http")) { statisticsServer = DEFAULT_STATISTICS_SERVER; } if (tracer.isFineEnabled()) { tracer.fine("statisticsServer: " + statisticsServer); } //define remote server address (optionally) statsReporter.setRemoteServer(statisticsServer); String projectName = System.getProperty("RestcommProjectName", "jainslee"); String projectType = System.getProperty("RestcommProjectType", "community"); String projectVersion = System.getProperty("RestcommProjectVersion", Version.getVersionProperty(Version.RELEASE_VERSION)); if (tracer.isFineEnabled()) { tracer.fine("Restcomm Stats " + projectName + " " + projectType + " " + projectVersion); } statsReporter.setProjectName(projectName); statsReporter.setProjectType(projectType); statsReporter.setVersion(projectVersion); Version.printVersion(); // TODO: define periodicity - now to once a minute (for testing) //define periodicity - default to once a day //statsReporter.start(86400, TimeUnit.SECONDS); raContext.getTimer().schedule(new StatisticsTimerTask(), 0, 30 * 1000); }