Search in sources :

Example 1 with BuildRuleDurationTracker

use of com.facebook.buck.rules.BuildRuleDurationTracker in project buck by facebook.

the class SuperConsoleEventBusListenerTest method setUp.

@Before
public void setUp() {
    vfs = Jimfs.newFileSystem(Configuration.unix());
    logPath = vfs.getPath("log.txt");
    durationTracker = new BuildRuleDurationTracker();
}
Also used : BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker) Before(org.junit.Before)

Example 2 with BuildRuleDurationTracker

use of com.facebook.buck.rules.BuildRuleDurationTracker in project buck by facebook.

the class RuleKeyLoggerListenerTest method setUp.

@Before
public void setUp() throws IOException {
    tempDirectory = new TemporaryFolder();
    tempDirectory.create();
    projectFilesystem = new ProjectFilesystem(tempDirectory.getRoot().toPath());
    outputExecutor = MostExecutors.newSingleThreadExecutor(new CommandThreadFactory(getClass().getName()));
    info = InvocationInfo.of(new BuildId(), false, false, "topspin", tempDirectory.getRoot().toPath());
    durationTracker = new BuildRuleDurationTracker();
}
Also used : BuildId(com.facebook.buck.model.BuildId) TemporaryFolder(org.junit.rules.TemporaryFolder) CommandThreadFactory(com.facebook.buck.log.CommandThreadFactory) ProjectFilesystem(com.facebook.buck.io.ProjectFilesystem) BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker) Before(org.junit.Before)

Example 3 with BuildRuleDurationTracker

use of com.facebook.buck.rules.BuildRuleDurationTracker in project buck by facebook.

the class SimpleConsoleEventBusListenerTest method setUp.

@Before
public void setUp() {
    vfs = Jimfs.newFileSystem(Configuration.unix());
    logPath = vfs.getPath("log.txt");
    durationTracker = new BuildRuleDurationTracker();
}
Also used : BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker) Before(org.junit.Before)

Example 4 with BuildRuleDurationTracker

use of com.facebook.buck.rules.BuildRuleDurationTracker in project buck by facebook.

the class BuildThreadStateRendererTest method createRuleBeginningEventOptional.

private static Optional<? extends BuildRuleEvent.BeginningBuildRuleEvent> createRuleBeginningEventOptional(long threadId, long timeMs, long durationMs, BuildRule rule) {
    BuildRuleDurationTracker durationTracker = new BuildRuleDurationTracker();
    durationTracker.setDuration(rule, new ClockDuration(durationMs, 0, 0));
    RuleKey ruleKey = new RuleKey(HashCode.fromString("aa"));
    return Optional.of(TestEventConfigurator.configureTestEventAtTime(BuildRuleEvent.resumed(rule, durationTracker, new FakeRuleKeyFactory(ImmutableMap.of(rule.getBuildTarget(), ruleKey))), timeMs, TimeUnit.MILLISECONDS, threadId));
}
Also used : FakeRuleKeyFactory(com.facebook.buck.rules.keys.FakeRuleKeyFactory) RuleKey(com.facebook.buck.rules.RuleKey) ClockDuration(com.facebook.buck.timing.ClockDuration) BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker)

Example 5 with BuildRuleDurationTracker

use of com.facebook.buck.rules.BuildRuleDurationTracker in project buck by facebook.

the class CacheRateStatsKeeperTest method finishedEvent.

BuildRuleEvent.Finished finishedEvent(CacheResult cacheResult) {
    BuildRule rule = FakeBuildRule.newEmptyInstance("//fake:rule");
    BuildRuleDurationTracker durationTracker = new BuildRuleDurationTracker();
    BuildRuleEvent.Started started = TestEventConfigurator.configureTestEvent(BuildRuleEvent.started(rule, durationTracker));
    return BuildRuleEvent.finished(started, BuildRuleKeys.of(new RuleKey("aa")), BuildRuleStatus.SUCCESS, cacheResult, Optional.empty(), Optional.empty(), Optional.empty());
}
Also used : RuleKey(com.facebook.buck.rules.RuleKey) FakeBuildRule(com.facebook.buck.rules.FakeBuildRule) BuildRule(com.facebook.buck.rules.BuildRule) BuildRuleEvent(com.facebook.buck.rules.BuildRuleEvent) BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker)

Aggregations

BuildRuleDurationTracker (com.facebook.buck.rules.BuildRuleDurationTracker)8 Before (org.junit.Before)6 BuildId (com.facebook.buck.model.BuildId)4 RuleKey (com.facebook.buck.rules.RuleKey)2 Clock (com.facebook.buck.timing.Clock)2 DefaultClock (com.facebook.buck.timing.DefaultClock)2 Random (java.util.Random)2 ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)1 CommandThreadFactory (com.facebook.buck.log.CommandThreadFactory)1 BuildRule (com.facebook.buck.rules.BuildRule)1 BuildRuleEvent (com.facebook.buck.rules.BuildRuleEvent)1 FakeBuildRule (com.facebook.buck.rules.FakeBuildRule)1 FakeRuleKeyFactory (com.facebook.buck.rules.keys.FakeRuleKeyFactory)1 ClockDuration (com.facebook.buck.timing.ClockDuration)1 TemporaryFolder (org.junit.rules.TemporaryFolder)1