Skip to content

Commit 1a1e721

Browse files
committed
Remove labelsCaptured logic
1 parent ce4e1a0 commit 1a1e721

3 files changed

Lines changed: 1 addition & 21 deletions

File tree

bindings/profilers/wall.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -573,10 +573,6 @@ NAN_MODULE_INIT(WallProfiler::Init) {
573573
GetLabels,
574574
SetLabels);
575575

576-
Nan::SetAccessor(tpl->InstanceTemplate(),
577-
Nan::New("labelsCaptured").ToLocalChecked(),
578-
GetLabelsCaptured);
579-
580576
Nan::SetPrototypeMethod(tpl, "start", Start);
581577
Nan::SetPrototypeMethod(tpl, "dispose", Dispose);
582578
Nan::SetPrototypeMethod(tpl, "stop", Stop);
@@ -625,19 +621,11 @@ NAN_SETTER(WallProfiler::SetLabels) {
625621
profiler->SetLabels(info.GetIsolate(), value);
626622
}
627623

628-
NAN_GETTER(WallProfiler::GetLabelsCaptured) {
629-
auto profiler = Nan::ObjectWrap::Unwrap<WallProfiler>(info.Holder());
630-
info.GetReturnValue().Set(profiler->GetLabelsCaptured());
631-
}
632-
633624
void WallProfiler::PushContext(int64_t time_from) {
634625
// Be careful this is called in a signal handler context therefore all
635626
// operations must be async signal safe (in particular no allocations). Our
636627
// ring buffer avoids allocations.
637628
contexts.push_back(SampleContext(labels_, time_from, v8::base::TimeTicks::Now()));
638-
if (labels_) {
639-
labelsCaptured = true;
640-
}
641629
}
642630

643631
} // namespace dd

bindings/profilers/wall.hh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class WallProfiler : public Nan::ObjectWrap {
2323
// avoid heap allocation. Need to figure out the right move/copy semantics in
2424
// and out of the ring buffer.
2525
ValuePtr labels_;
26-
bool labelsCaptured = false;
2726

2827
struct SampleContext {
2928
ValuePtr labels;
@@ -59,7 +58,6 @@ class WallProfiler : public Nan::ObjectWrap {
5958

6059
v8::Local<v8::Value> GetLabels(v8::Isolate*);
6160
void SetLabels(v8::Isolate*, v8::Local<v8::Value>);
62-
bool GetLabelsCaptured() { return std::exchange(labelsCaptured, false); }
6361

6462
void PushContext(int64_t time_from);
6563
void StartImpl(v8::Local<v8::String> name,
@@ -75,7 +73,6 @@ class WallProfiler : public Nan::ObjectWrap {
7573
static NAN_MODULE_INIT(Init);
7674
static NAN_GETTER(GetLabels);
7775
static NAN_SETTER(SetLabels);
78-
static NAN_GETTER(GetLabelsCaptured);
7976
};
8077

8178
} // namespace dd

ts/src/time-profiler.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ function startInternal(
111111
let runName = start();
112112
return {
113113
stop: majorVersion < 16 ? stopOld : stop,
114-
setLabels,
115-
labelsCaptured,
114+
setLabels
116115
};
117116

118117
function start() {
@@ -152,8 +151,4 @@ function startInternal(
152151
function setLabels(labels?: LabelSet) {
153152
profiler.labels = labels;
154153
}
155-
156-
function labelsCaptured() {
157-
return profiler.labelsCaptured;
158-
}
159154
}

0 commit comments

Comments
 (0)