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);
  }
Exemplo n.º 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;
  }
Exemplo n.º 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;
  }
Exemplo n.º 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));
  }