-
Notifications
You must be signed in to change notification settings - Fork 937
Switch performance event traffic to transport endpoint #2593
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
Changes from 13 commits
591c769
e86086a
3a704dd
3d5342a
8d505a7
cdc8501
26ea86b
ba78d97
4f025e4
b787386
8b8c321
4180537
0e69357
eb1bcba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# Unreleased | ||
- [changed] Update the transport mechanism of Fireperf events. | ||
|
||
# 0.2.30 | ||
- [changed] Internal transport protocol update from proto2 to proto3. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ import { SDK_VERSION } from '../constants'; | |
import * as attributeUtils from '../utils/attributes_utils'; | ||
import { createNetworkRequestEntry } from '../resources/network_request'; | ||
import '../../test/setup'; | ||
import { mergeStrings } from '../utils/string_merger'; | ||
|
||
describe('Performance Monitoring > perf_logger', () => { | ||
const IID = 'idasdfsffe'; | ||
|
@@ -301,5 +302,82 @@ describe('Performance Monitoring > perf_logger', () => { | |
EXPECTED_NETWORK_MESSAGE | ||
); | ||
}); | ||
|
||
// Performance SDK doesn't instrument requests sent from SDK itself, therefore blacklist | ||
// requests sent to cc endpoint. | ||
it('skips performance collection if domain is cc', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why we want to skip the collection in this case? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fireperf automatically collects network request (including request to cc). However, to avoid infinite loop of network request collection (request to CC -> request is captured as performance resource -> another request to CC), if the domain is cc, then we will not collect the network request. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks James. Based on our offline discussion this is validating that we don't instrument Network Request to CC/FL sent by our own SDK. Since it took a while to understand this scenario it would be good to add some documentation to make it clear. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you Raman! Added comments to explain that we don't instrument requests sent from SDK itself in both production code and test code. |
||
const CC_NETWORK_PERFORMANCE_ENTRY: PerformanceResourceTiming = { | ||
connectEnd: 0, | ||
connectStart: 0, | ||
decodedBodySize: 0, | ||
domainLookupEnd: 0, | ||
domainLookupStart: 0, | ||
duration: 39.610000094398856, | ||
encodedBodySize: 0, | ||
entryType: 'resource', | ||
fetchStart: 5645.689999917522, | ||
initiatorType: 'fetch', | ||
name: 'https://firebaselogging.googleapis.com/v0cc/log?message=a', | ||
nextHopProtocol: 'http/2+quic/43', | ||
redirectEnd: 0, | ||
redirectStart: 0, | ||
requestStart: 0, | ||
responseEnd: 5685.300000011921, | ||
responseStart: 0, | ||
secureConnectionStart: 0, | ||
startTime: 5645.689999917522, | ||
transferSize: 0, | ||
workerStart: 0, | ||
toJSON: () => {} | ||
}; | ||
getIidStub.returns(IID); | ||
SettingsService.getInstance().loggingEnabled = true; | ||
SettingsService.getInstance().logNetworkAfterSampling = true; | ||
// Calls logNetworkRequest under the hood. | ||
createNetworkRequestEntry(CC_NETWORK_PERFORMANCE_ENTRY); | ||
clock.tick(1); | ||
|
||
expect(addToQueueStub).not.called; | ||
}); | ||
|
||
// Performance SDK doesn't instrument requests sent from SDK itself, therefore blacklist | ||
// requests sent to fl endpoint. | ||
it('skips performance collection if domain is fl', () => { | ||
const FL_NETWORK_PERFORMANCE_ENTRY: PerformanceResourceTiming = { | ||
connectEnd: 0, | ||
connectStart: 0, | ||
decodedBodySize: 0, | ||
domainLookupEnd: 0, | ||
domainLookupStart: 0, | ||
duration: 39.610000094398856, | ||
encodedBodySize: 0, | ||
entryType: 'resource', | ||
fetchStart: 5645.689999917522, | ||
initiatorType: 'fetch', | ||
name: mergeStrings( | ||
'hts/frbslgigp.ogepscmv/ieo/eaylg', | ||
'tp:/ieaeogn-agolai.o/1frlglgc/o' | ||
), | ||
nextHopProtocol: 'http/2+quic/43', | ||
zijianjoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
redirectEnd: 0, | ||
redirectStart: 0, | ||
requestStart: 0, | ||
responseEnd: 5685.300000011921, | ||
responseStart: 0, | ||
secureConnectionStart: 0, | ||
startTime: 5645.689999917522, | ||
transferSize: 0, | ||
workerStart: 0, | ||
toJSON: () => {} | ||
}; | ||
getIidStub.returns(IID); | ||
SettingsService.getInstance().loggingEnabled = true; | ||
SettingsService.getInstance().logNetworkAfterSampling = true; | ||
// Calls logNetworkRequest under the hood. | ||
createNetworkRequestEntry(FL_NETWORK_PERFORMANCE_ENTRY); | ||
clock.tick(1); | ||
|
||
expect(addToQueueStub).not.called; | ||
}); | ||
zijianjoy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); | ||
}); |
Uh oh!
There was an error while loading. Please reload this page.