Search in sources :

Example 6 with BuildRuleDurationTracker

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

the class ChromeTraceBuildListenerTest method setUp.

@Before
public void setUp() throws IOException {
    invocationInfo = InvocationInfo.builder().setTimestampMillis(TimeUnit.NANOSECONDS.toMillis(TIMESTAMP_NANOS)).setBuckLogDir(tmpDir.getRoot().toPath().resolve("buck-out/log")).setBuildId(new BuildId("BUILD_ID")).setSubCommand("no_sub_command").setIsDaemon(false).setSuperConsoleEnabled(false).build();
    durationTracker = new BuildRuleDurationTracker();
}
Also used : BuildId(com.facebook.buck.model.BuildId) BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker) Before(org.junit.Before)

Example 7 with BuildRuleDurationTracker

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

the class MachineReadableLogJsonViewTest method setUp.

@Before
public void setUp() {
    Clock clock = new DefaultClock();
    timestamp = clock.currentTimeMillis();
    nanoTime = clock.nanoTime();
    // Not using real value as not all JVMs will support thread user time.
    threadUserNanoTime = new Random().nextLong();
    threadId = 0;
    buildId = new BuildId("Test");
    durationTracker = new BuildRuleDurationTracker();
}
Also used : Random(java.util.Random) BuildId(com.facebook.buck.model.BuildId) DefaultClock(com.facebook.buck.timing.DefaultClock) DefaultClock(com.facebook.buck.timing.DefaultClock) Clock(com.facebook.buck.timing.Clock) BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker) Before(org.junit.Before)

Example 8 with BuildRuleDurationTracker

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

the class EventSerializationTest method setUp.

@Before
public void setUp() {
    Clock clock = new DefaultClock();
    timestamp = clock.currentTimeMillis();
    nanoTime = clock.nanoTime();
    // Not using real value as not all JVMs will support thread user time.
    threadUserNanoTime = new Random().nextLong();
    threadId = 0;
    buildId = new BuildId("Test");
    durationTracker = new BuildRuleDurationTracker();
    EventKey.setSequenceValueForTest(4242L);
}
Also used : Random(java.util.Random) BuildId(com.facebook.buck.model.BuildId) DefaultClock(com.facebook.buck.timing.DefaultClock) DefaultClock(com.facebook.buck.timing.DefaultClock) Clock(com.facebook.buck.timing.Clock) BuildRuleDurationTracker(com.facebook.buck.rules.BuildRuleDurationTracker) Before(org.junit.Before)

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