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

clean up PageviewPerformanceData tick a bit #9602

Merged
merged 2 commits into from
Jul 17, 2023
Merged

Conversation

jwunderl
Copy link
Member

@jwunderl jwunderl commented Jul 12, 2023

Here's an example of what the tick looks like when it goes through this fn:

into ->

{
    "name": "Microsoft.ApplicationInsights.{0}.PageviewPerformance",
    "time": "2023-07-12T16:44:43.715Z",
    "iKey": "9801ed01-c40f-46ec-aa40-2a1742a9e71c",
    "ext": {
        "app": {
            "sesId": "{b64ish}"
        },
        "device": {
            "localId": "browser",
            "deviceClass": "Browser"
        },
        "trace": {
            "traceID": "{b16ish}",
            "name": "/75618-11489-17671-85517"
        },
        "user": {
            "id": "{b64ish}"
        }
    },
    "tags": [],
    "data": {
        "duration": 3642.60000000149
    },
    "baseType": "PageviewPerformanceData",
    "baseData": {
        "name": "world_race",
        "uri": "http://localhost:3232/75618-11489-17671-85517",
        "isValid": true,
        "durationMs": 3642.60000000149,
        "duration": "00:00:03.643",
        "perfTotal": "00:00:03.643",
        "networkConnect": "00:00:00.319",
        "sentRequest": "00:00:00.876",
        "receivedResponse": "00:00:00.002",
        "domProcessing": "00:00:02.446"
    },
    "ver": "4.0"
}

end of fn

{
    "name": "Microsoft.ApplicationInsights.{0}.PageviewPerformance",
    "time": "2023-07-12T16:44:43.715Z",
    "iKey": "9801ed01-c40f-46ec-aa40-2a1742a9e71c",
    "ext": {
        "app": {
            "sesId": "{b64ish}"
        },
        "device": {
            "localId": "browser",
            "deviceClass": "Browser"
        },
        "trace": {
            "traceID": "{b16ish}",
            "name": "/xxxxx-xxxxx-xxxxx-xxxxx"
        },
        "user": {
            "id": "{b64ish}"
        }
    },
    "tags": [],
    "data": {
        "duration": 3642.60000000149
    },
    "baseType": "PageviewPerformanceData",
    "baseData": {
        "name": "http://localhost:3232",
        "uri": "http://localhost:3232/xxxxx-xxxxx-xxxxx-xxxxx",
        "isValid": true,
        "durationMs": 3642.60000000149,
        "duration": "00:00:03.643",
        "perfTotal": "00:00:03.643",
        "networkConnect": "00:00:00.319",
        "sentRequest": "00:00:00.876",
        "receivedResponse": "00:00:00.002",
        "domProcessing": "00:00:02.446",
        "properties": {
            "pageName": "world_race",
            "cookie": false
        }
    },
    "ver": "4.0"
}

It looks like these are the ones that are getting specially handled to create the perf data table with non matching names.

@jwunderl jwunderl requested review from abchatra, thsparks and a team and removed request for thsparks July 12, 2023 16:46
@abchatra
Copy link
Collaborator

@thsparks probably needs to review as well.

return false;
}

if (envelope.baseType == "PageviewPerformanceData") {
var pageName = envelope.baseData.name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is var used throughout instead of const? I don't see any reassignment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just matching the rest of the file since this one's going to be ported to several editors; this one's directly embedded in the page (not ts or anything) so we've historically been pretty cautious of using newfangled javascript features, though I believe we have stopped having to support editors that this would have caused problems in so should be fine to move over to let / const's across the board now (though I'd leave that for a separate pr most likely, just for ease of porting)

@jwunderl jwunderl requested a review from thsparks July 12, 2023 17:18
@jwunderl jwunderl merged commit 83e1599 into master Jul 17, 2023
6 checks passed
@jwunderl jwunderl deleted the rearrangePagePerfTick branch July 17, 2023 22:02
jwunderl added a commit that referenced this pull request Jul 17, 2023
* clean up PageviewPerformanceData tick a bit

* remove the if not props as that seems to be getting race conditioned or something
jwunderl added a commit that referenced this pull request Jul 17, 2023
* clean up PageviewPerformanceData tick a bit

* remove the if not props as that seems to be getting race conditioned or something
jwunderl added a commit that referenced this pull request Jul 20, 2023
* clean up PageviewPerformanceData tick a bit

* remove the if not props as that seems to be getting race conditioned or something
jwunderl added a commit that referenced this pull request Jul 20, 2023
* clean up PageviewPerformanceData tick a bit

* remove the if not props as that seems to be getting race conditioned or something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants