private static HttpArtifactCacheEvent.Finished.Builder createBuilder() {

    HttpArtifactCacheEvent.Scheduled scheduledEvent =
        HttpArtifactCacheEvent.newStoreScheduledEvent(
            Optional.of("target"), ImmutableSet.<RuleKey>of());
    HttpArtifactCacheEvent.Started startedEvent =
        HttpArtifactCacheEvent.newStoreStartedEvent(scheduledEvent);
    configureEvent(startedEvent);
    return HttpArtifactCacheEvent.newFinishedEventBuilder(startedEvent);
  }
Example #2
0
  public static HttpArtifactCacheEvent.Scheduled postStoreScheduled(
      BuckEventBus eventBus, long threadId, String target, long timeInMs) {
    HttpArtifactCacheEvent.Scheduled storeScheduled =
        HttpArtifactCacheEvent.newStoreScheduledEvent(Optional.of(target), ImmutableSet.of());

    eventBus.postWithoutConfiguring(
        configureTestEventAtTime(storeScheduled, timeInMs, TimeUnit.MILLISECONDS, threadId));
    return storeScheduled;
  }
Example #3
0
  public static HttpArtifactCacheEvent.Started postStoreStarted(
      BuckEventBus eventBus,
      long threadId,
      long timeInMs,
      HttpArtifactCacheEvent.Scheduled storeScheduled) {
    HttpArtifactCacheEvent.Started storeStartedOne =
        HttpArtifactCacheEvent.newStoreStartedEvent(storeScheduled);

    eventBus.postWithoutConfiguring(
        configureTestEventAtTime(storeStartedOne, timeInMs, TimeUnit.MILLISECONDS, threadId));
    return storeStartedOne;
  }
Example #4
0
  public static void postStoreFinished(
      BuckEventBus eventBus,
      long threadId,
      long artifactSizeInBytes,
      long timeInMs,
      boolean success,
      HttpArtifactCacheEvent.Started storeStartedOne) {
    HttpArtifactCacheEvent.Finished storeFinished =
        HttpArtifactCacheEvent.newFinishedEventBuilder(storeStartedOne)
            .setWasUploadSuccessful(success)
            .setArtifactSizeBytes(artifactSizeInBytes)
            .build();

    eventBus.postWithoutConfiguring(
        configureTestEventAtTime(storeFinished, timeInMs, TimeUnit.MILLISECONDS, threadId));
  }