MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/profiler/internal/traceme_recorder_test.cc:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31constexpr static uint64 kNanosInSec = 1000000000;
32
33TEST(RecorderTest, SingleThreaded) {
34 uint64 start_time = Env::Default()->NowNanos();
35 uint64 end_time = start_time + kNanosInSec;
36
37 TraceMeRecorder::Record({1, "before", start_time, end_time});
38 TraceMeRecorder::Start(/*level=*/1);
39 TraceMeRecorder::Record({2, "during1", start_time, end_time});
40 TraceMeRecorder::Record({3, "during2", start_time, end_time});
41 auto results = TraceMeRecorder::Stop();
42 TraceMeRecorder::Record({4, "after", start_time, end_time});
43
44 ASSERT_EQ(results.size(), 1);
45 EXPECT_THAT(results[0].events,
46 ::testing::ElementsAre(Named("during1"), Named("during2")));
47}
48
49void SpinNanos(int nanos) {
50 uint64 deadline = Env::Default()->NowNanos() + nanos;

Callers

nothing calls this directly

Calls 14

DefaultFunction · 0.85
SpinNanosFunction · 0.85
HasBeenNotifiedMethod · 0.80
StrCatFunction · 0.50
NowNanosMethod · 0.45
sizeMethod · 0.45
ScheduleMethod · 0.45
WaitForNotificationMethod · 0.45
loadMethod · 0.45
SleepForMicrosecondsMethod · 0.45
NotifyMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected