Package org.ngrinder.http

Examples of org.ngrinder.http.MeasureProtocolRequest


  public void reportUsage() {
    if (config.isUsageReportEnabled()) {
      doRandomDelay();
      GoogleAnalytic googleAnalytic = new GoogleAnalytic(ControllerConstants.GOOGLE_ANALYTICS_APP_NAME,
          config.getVersion(), ControllerConstants.GOOGLE_ANALYTICS_TRACKING_ID);
      MeasureProtocolRequest measureProtocolRequest = googleAnalytic.getMeasureProtocolRequest();
      measureProtocolRequest.setEventCategory("usage");
      measureProtocolRequest.setEventAction("executions");
      String currentAddress = NetworkUtils.getLocalHostAddress();
      Date yesterday = DateUtils.addDays(new Date(), -1);
      Date start = DateUtils.truncate(yesterday, Calendar.DATE);
      Date end = DateUtils.addMilliseconds(DateUtils.ceiling(yesterday, Calendar.DATE), -1);
      googleAnalytic.sendStaticDataToUA(currentAddress, String.valueOf(getUsage(start, end)));
View Full Code Here

TOP

Related Classes of org.ngrinder.http.MeasureProtocolRequest

Copyright © 2018 www.massapicom. 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.