-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[admin] (temp) disable telemetry for gitpod.io #8386
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
Conversation
AlexTugarev
commented
Feb 22, 2022
•
edited
Loading
edited
e1ddc5b
to
be8cf75
Compare
Codecov Report
@@ Coverage Diff @@
## main #8386 +/- ##
=========================================
+ Coverage 8.41% 11.17% +2.75%
=========================================
Files 33 18 -15
Lines 2340 993 -1347
=========================================
- Hits 197 111 -86
+ Misses 2138 880 -1258
+ Partials 5 2 -3
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@@ -22,11 +22,14 @@ export default function Settings() { | |||
const { user } = useContext(UserContext); | |||
|
|||
useEffect(() => { | |||
if (isGitpodIo()) { | |||
return; // temporarily disable to avoid hight CPU on the DB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need to disable it since the missing dependency arg is what's causing the infinite loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes, because we should not be giving our users insights or the permission to see/set this page for the whole SAAS instance? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't causing an infinite loop. 😌 It's just on each re-render it was called, instead of a single init call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, if it's only the missing dependency arg. It could also be that this query is too expensive with our large instance DB:
gitpod/components/gitpod-db/src/typeorm/workspace-db-impl.ts
Lines 337 to 344 in 5f6114c
public async getInstanceCount(type?: string): Promise<number> { | |
const workspaceInstanceRepo = await this.getWorkspaceInstanceRepo(); | |
const queryBuilder = workspaceInstanceRepo.createQueryBuilder("wsi") | |
.leftJoinAndMapOne("wsi.workspace", DBWorkspace, "ws", "wsi.workspaceId = ws.id") | |
.where("ws.type = :type", { type: type ? type.toString() : "regular" }); // only regular workspaces by default | |
return await queryBuilder.getCount(); | |
} |
Don't know how to figure that out, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. The useEffect issue was not a big deal, it just amplified the actual problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM