Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

(analytics) add repo meta usage ping#51921

Merged
erzhtor merged 12 commits into
mainfrom
erzhtor/add-repo-meta-usage-ping
May 24, 2023
Merged

(analytics) add repo meta usage ping#51921
erzhtor merged 12 commits into
mainfrom
erzhtor/add-repo-meta-usage-ping

Conversation

@erzhtor

@erzhtor erzhtor commented May 15, 2023

Copy link
Copy Markdown
Contributor

Part of https://github.com/sourcegraph/pr-faqs/issues/96. Related to https://github.com/sourcegraph/analytics/pull/928.

This PR

  • adds backend event logs on repo metadata create/update/delete
  • adds repo metadata daily/weekly/monthly usage ping
Example:
"repoMetadataUsage": {
        "Daily": {
            "StartTime": "2023-05-14T00:00:00Z",
            "SearchFilterUsage": {
                "UserCount": 1,
                "EventsCount": 2
            },
            "CreateRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 4
            },
            "DeleteRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 1
            },
            "UpdateRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 1
            }
        },
        "Weekly": {
            "StartTime": "2023-05-14T00:00:00Z",
            "SearchFilterUsage": {
                "UserCount": 1,
                "EventsCount": 2
            },
            "CreateRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 4
            },
            "DeleteRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 1
            },
            "UpdateRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 1
            }
        },
        "Monthly": {
            "StartTime": "2023-05-01T00:00:00Z",
            "SearchFilterUsage": {
                "UserCount": 2,
                "EventsCount": 25
            },
            "CreateRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 4
            },
            "DeleteRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 1
            },
            "UpdateRepoMetadata": {
                "UserCount": 1,
                "EventsCount": 1
            }
        },
        "IsEnabled": false
    },

Test plan

@erzhtor erzhtor requested review from a team, nathan-downs and ryphil May 15, 2023 11:06
@erzhtor erzhtor self-assigned this May 15, 2023
@cla-bot cla-bot Bot added the cla-signed label May 15, 2023
@erzhtor erzhtor requested review from akalia25 and toolmantim May 15, 2023 11:08

@nathan-downs nathan-downs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SQL aggregation logic looks good to me, spun up sg locally and verified the internal ping structure but not the functionality of the actual data aggregations.

@erzhtor erzhtor force-pushed the erzhtor/add-repo-meta-usage-ping branch from 99d9214 to e552bb5 Compare May 17, 2023 12:57

@toolmantim toolmantim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! Would it be worth tracking the usage of people clicking the new badge links (from the search and the repo root page)?

@erzhtor erzhtor changed the title (analytics): add repo meta usage ping (analytics) add repo meta usage ping May 23, 2023
@erzhtor erzhtor force-pushed the erzhtor/add-repo-meta-usage-ping branch from ac1b84d to 3ea2d58 Compare May 23, 2023 09:24
@erzhtor erzhtor force-pushed the erzhtor/add-repo-meta-usage-ping branch from 3ea2d58 to 8141edd Compare May 24, 2023 07:07
@sourcegraph-bot

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff bad2254...8141edd.

Notify File(s)
@sourcegraph/delivery doc/admin/pings.md

@sourcegraph-buildkite

Copy link
Copy Markdown
Collaborator

Bundle size report 📦

Initial size Total size Async size Modules
0.00% (0.00 kb) 0.00% (+0.10 kb) 0.00% (+0.10 kb) 0.00% (0)

Look at the Statoscope report for a full comparison between the commits 8141edd and bad2254 or learn more.

Open explanation
  • Initial size is the size of the initial bundle (the one that is loaded when you open the page)
  • Total size is the size of the initial bundle + all the async loaded chunks
  • Async size is the size of all the async loaded chunks
  • Modules is the number of modules in the initial bundle

@sourcegraph-bot

Copy link
Copy Markdown
Contributor

📖 Storybook live preview

@erzhtor erzhtor enabled auto-merge (squash) May 24, 2023 07:25
@erzhtor erzhtor merged commit c205ded into main May 24, 2023
@erzhtor erzhtor deleted the erzhtor/add-repo-meta-usage-ping branch May 24, 2023 07:25
ErikaRS pushed a commit that referenced this pull request Jun 22, 2023
* (analytics) adds backend event logs on repo metadata create/update/delete
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants