-
Notifications
You must be signed in to change notification settings - Fork 5
NEW @W-17915999@ Implemented engine-level telemetry framework. #265
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
fc10831
to
9a9ba7f
Compare
9a9ba7f
to
5841976
Compare
*/ | ||
export type TelemetryEvent = { | ||
type: EventType.TelemetryEvent, | ||
key: string, |
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.
A string-type key
and a completely loose data
object seemed to me to strike the balance between structure and flexibility that we want for telemetry.
toAbsolutePath, | ||
UniqueIdGenerator | ||
} from "./utils"; | ||
import {EngineProgressAggregator, SimpleUniqueIdGenerator, toAbsolutePath, UniqueIdGenerator} from "./utils"; |
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 why my IDE saw fit to change this. I can change it back if we care.
286f3f4
to
ff99198
Compare
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 have a lint error (unused import to fix). And I left a few comments. Otherwise, approved.
// istanbul ignore next | ||
private emitTelemetryEvent(eventName: string, data: TelemetryData): void { | ||
this.emitEvent({ | ||
type: EventType.TelemetryEvent, | ||
timestamp: this.clock.now(), | ||
eventName, | ||
uuid: this.uniqueIdGenerator.getUniversallyUniqueId(), | ||
data | ||
}); | ||
} |
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.
Probably didn't need to add this until we actually had a use for it. But if you want to update the CLI to prepare for the future scenario of possibly updating core with a core TelemetryEvent, that's fine to do now I suppose. Up to you.
@@ -395,6 +400,17 @@ export class CodeAnalyzer { | |||
}) | |||
} | |||
|
|||
// istanbul ignore next |
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.
If we do add this in even though it isn't being used (which probably means we shouldn't have this added to our code yet), can we at least add in a comment saying that this is unused currently, but when used to remove that istanbul ignore next.
import path from "node:path"; | ||
import crypto from "node:crypto"; |
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.
Should both of these instead be import * as path
and import * as crypto
instead of directly importing a namespace?
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'll do that for safety's sake, though I'm not positive it actually matters here.
This PR does the following: