congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
com.ning.metrics.eventtracker
Code IndexAdd Tabnine to your IDE (free)

How to use com.ning.metrics.eventtracker

Best Java code snippets using com.ning.metrics.eventtracker (Showing top 20 results out of 315)

origin: com.ning/metrics.eventtracker-http

  @Override
  protected void configure()
  {
    install(new CollectorControllerMBeanModule());
  }
}
origin: com.ning/metrics.eventtracker-http

HttpSender(final ThreadSafeAsyncHttpClient client, final long httpMaxWaitTimeInMillis, final Timer sendTimer, final int httpWorkersPoolSize)
{
  this.client = client;
  this.httpMaxWaitTimeInMillis = httpMaxWaitTimeInMillis;
  this.sendTimer = sendTimer;
  this.workers = new LocalQueueAndWorkers(httpWorkersPoolSize);
}
origin: com.ning/metrics.eventtracker-common

  @Override
  public void handle(final File file, final CallbackHandler handler)
  {
    eventSender.send(file, handler);
  }
}, config.getSpoolDirectoryName(), config.isFlushEnabled(), config.getFlushIntervalInSeconds(), executor,
origin: com.ning/metrics.eventtracker-http

  @Override
  protected void configure()
  {
    super.configure();

    switch (eventTrackerConfig.getType()) {
      case COLLECTOR:
        final EventSender httpSender = new HttpSender(
          eventTrackerConfig.getCollectorHost(),
          eventTrackerConfig.getCollectorPort(),
          eventTrackerConfig.getEventType(),
          eventTrackerConfig.getHttpMaxWaitTimeInMillis(),
          eventTrackerConfig.getHttpMaxKeepAlive().getMillis(),
          eventTrackerConfig.getHttpWorkersPoolSize()
        );
        bind(EventSender.class).toInstance(httpSender);
        log.info("Enabled HTTP Event Logging");
        break;
      case NO_LOGGING:
        bind(EventSender.class).to(NoLoggingSender.class).asEagerSingleton();
        log.info("Disabled Event Logging");
        break;
      default:
        throw new IllegalStateException("Unknown type " + eventTrackerConfig.getType());
    }
  }
}
origin: com.ning/metrics.eventtracker-smile

  @Override
  protected void configure()
  {
    super.configure();

    switch (eventTrackerConfig.getEventType()) {
      case SMILE:
        bind(EventSerializer.class).toInstance(new SmileEnvelopeEventSerializer(false));
        break;
      case JSON:
        bind(EventSerializer.class).toInstance(new SmileEnvelopeEventSerializer(true));
        break;
      default:
        bind(EventSerializer.class).to(ObjectOutputEventSerializer.class);
        break;
    }
  }
}
origin: com.ning/metrics.eventtracker-common

public void close()
{
  setAcceptEvents(false);
  try {
    commit();
    flush();
    eventWriter.close();
  }
  catch (IOException e) {
    log.warn("Got I/O exception closing the eventtracker library: " + e);
  }
}
origin: com.ning/metrics.eventtracker-common

  protected static void mainEventTrackerShutdownHook(
    final EventSender eventSender,
    final CollectorController controller)
  {
    log.info("Closing the collector controller");
    controller.close();

    log.info("Closing event sender");
    eventSender.close();
  }
}
origin: com.ning/metrics.eventtracker-smile

singletonController = new HttpCollectorFactory(
  collectorHost,
  collectorPort,
  maxUncommittedPeriodInSeconds,
  httpWorkersPoolSize
).get();
origin: com.ning/metrics.eventtracker-common

@Inject
public ThresholdEventWriterProvider(final DiskSpoolEventWriter eventWriter, final EventTrackerConfig config)
{
  this.eventWriter = eventWriter;
  this.maxUncommittedWriteCount = config.getMaxUncommittedWriteCount();
  this.maxUncommittedPeriodInSeconds = config.getMaxUncommittedPeriodInSeconds();
}
origin: com.ning/metrics.eventtracker-common

@Override
public CollectorController get()
{
  final CollectorController controller = new CollectorController(eventWriter);
  // Make sure to flush all files on shutdown
  Runtime.getRuntime().addShutdownHook(new Thread()
  {
    @Override
    public void run()
    {
      mainEventTrackerShutdownHook(eventSender, controller);
    }
  });
  return controller;
}
origin: com.ning.jetty/ning-service-skeleton-base

private void installEventtracker()
{
  if (!trackRequests) {
    return;
  }
  install(new CollectorControllerSmileModule());
  install(new CollectorControllerHttpMBeanModule());
  bind(Tracker.class).to(CollectorTracker.class).asEagerSingleton();
  filter("*").through(TrackerFilter.class);
}
origin: com.ning/metrics.eventtracker-common

  @Override
  public void run()
  {
    mainEventTrackerShutdownHook(eventSender, controller);
  }
});
origin: com.ning/metrics.eventtracker-http

  public void submitRequest()
  {
    client.executeRequest(file, completionHandler);
  }
}
origin: com.ning/metrics.eventtracker-smile

  public static void shutdown()
  {
    eventSender.close();
  }
}
origin: com.ning/metrics.eventtracker-smile

  @Override
  public void handle(final File file, final CallbackHandler handler)
  {
    eventSender.send(file, handler);
  }
}, spoolDirectoryName, isFlushEnabled, flushIntervalInSeconds, new FailsafeScheduledExecutor(1, "EventtrackerFlusher"),
origin: com.ning/metrics.eventtracker-http

public final boolean isExpired()
{
  return isExpired(System.currentTimeMillis());
}
origin: com.ning/metrics.eventtracker-http

  public void run()
  {
    while (true) {
      try {
        final HttpJob job = jobQueue.take();
        job.submitRequest();
      }
      catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
        return;
      }
    }
  }
}
origin: com.ning/metrics.eventtracker-http

public LocalQueueAndWorkers(final int senderCount)
{
  this.executor = new FailsafeScheduledExecutor(senderCount, "http-SenderWorkers");
  for (int idx = 0; idx < senderCount; idx++) {
    executor.submit(new SenderWorker(queue));
  }
}
origin: com.ning/metrics.eventtracker-http

public HttpSender(final String collectorHost, final int collectorPort, final EventType eventType,
         final long httpMaxWaitTimeInMillis, final long httpMaxKeepAliveInMillis, final int httpWorkersPoolSize)
{
  this(new ThreadSafeAsyncHttpClient(collectorHost, collectorPort, eventType, httpMaxKeepAliveInMillis),
     httpMaxWaitTimeInMillis,
     Metrics.newTimer(HttpSender.class, collectorHost.replace(":", "_"), TimeUnit.MILLISECONDS, TimeUnit.SECONDS),
     httpWorkersPoolSize);
}
origin: com.ning/metrics.eventtracker-http

public ThreadSafeAsyncHttpClient(final String collectorHost, final int collectorPort, final EventType eventType, final long httpMaxKeepAliveInMillis)
{
  this.collectorURI = String.format("http://%s:%d%s", collectorHost, collectorPort, URI_PATH);
  this.eventType = eventType;
  this.httpConnectionExpiration = new ExpirationTimer(httpMaxKeepAliveInMillis);
  // CAUTION: it is not enforced that the actual event encoding type on the wire matches what the config says it is
  // the event encoding type is determined by the Event's writeExternal() method.
  this.clientConfig = new AsyncHttpClientConfig.Builder()
      .setIdleConnectionInPoolTimeoutInMs(DEFAULT_IDLE_CONNECTION_IN_POOL_TIMEOUT_IN_MS)
      .setConnectionTimeoutInMs(100)
      .setMaximumConnectionsPerHost(-1) // unlimited connections
      .build();
}
com.ning.metrics.eventtracker

Most used classes

  • CollectorController
    Main entry point of the library. The CollectorController is responsible for forwarding events to the
  • EventTrackerConfig
  • CollectorControllerHttpMBeanModule
    Expose JMX properties for the eventtracker library. To enable them, install this module and configur
  • CollectorControllerHttpModule
    Wires all pieces related to talking to the Collector core. See http://github.com/pierre/collector No
  • CollectorControllerMBeanModule
    Expose JMX properties for the eventtracker library. To enable them, install this module and configur
  • CollectorControllerSmileModule,
  • HttpSender,
  • CollectorControllerProvider,
  • EventSender,
  • ExpirationTimer,
  • HttpCollectorFactory,
  • HttpJob,
  • LocalQueueAndWorkers,
  • SenderWorker,
  • ThreadSafeAsyncHttpClient
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now