Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI testing PR - DO NOT MERGE #383

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
tweak delayed span code
kstenerud committed Jan 27, 2025
commit a8c276814d05566859c090c8310d267240dc5b8a
20 changes: 10 additions & 10 deletions Sources/BugsnagPerformance/Private/BugsnagPerformanceImpl.mm
Original file line number Diff line number Diff line change
@@ -311,19 +311,19 @@
// Delay so that the sampler has time to fetch one more sample.
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((SAMPLER_INTERVAL_SECONDS + 0.5) * NSEC_PER_SEC)),
dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0), ^{
BSGLogTrace(@"BugsnagPerformanceImpl::sendCurrentBatchTask(): Delayed %f seconds, now getting system info", SAMPLER_INTERVAL_SECONDS + 0.5);
for(BugsnagPerformanceSpan *span: spans) {
auto samples = systemInfoSampler_.samplesAroundTimePeriod(span.actuallyStartedAt, span.actuallyEndedAt);
BSGLogTrace(@"BugsnagPerformanceImpl::sendCurrentBatchTask(): System info sample size = %zu", samples.size());
if (samples.size() >= 2) {
if (shouldSampleCPU(span)) {
BSGLogInfo(@"BugsnagPerformanceImpl::sendCurrentBatchTask(): Getting CPU sample attributes for span %@", span.name);
// BSGLogTrace(@"BugsnagPerformanceImpl::sendCurrentBatchTask(): Delayed %f seconds, now getting system info", SAMPLER_INTERVAL_SECONDS + 0.5);
// for(BugsnagPerformanceSpan *span: spans) {
// auto samples = systemInfoSampler_.samplesAroundTimePeriod(span.actuallyStartedAt, span.actuallyEndedAt);
// BSGLogTrace(@"BugsnagPerformanceImpl::sendCurrentBatchTask(): System info sample size = %zu", samples.size());
// if (samples.size() >= 2) {
// if (shouldSampleCPU(span)) {
// BSGLogTrace(@"BugsnagPerformanceImpl::sendCurrentBatchTask(): Getting CPU sample attributes for span %@", span.name);
// [span forceMutate:^() {
// [span internalSetMultipleAttributes:spanAttributesProvider_->cpuSampleAttributes(samples)];
// }];
}
}
}
// }
// }
// }

#ifndef __clang_analyzer__
BSGLogTrace(@"BugsnagPerformanceImpl::sendCurrentBatchTask(): Sending %zu sampled spans (out of %zu)", origSpansSize, spans.count);