-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Telemetry for Global Search #160224
Telemetry for Global Search #160224
Conversation
5f79d3f
to
147ecd0
Compare
147ecd0
to
eb29ae5
Compare
Pinging @elastic/appex-sharedux (Team:SharedUX) |
…sullivan/kibana into serverless/add-global-search-telemetry
public searchFocus() { | ||
this.trackUiMetric(METRIC_TYPE.COUNT, CountMetric.SEARCH_FOCUS); | ||
|
||
this.focusStart = new Date(Date.now()).valueOf(); |
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.
Why not simply: this.focusStart = Date.now();
😊 Same on L71
public searchBlur() { | ||
const focusTime = new Date(Date.now()).valueOf() - this.focusStart; | ||
if (focusTime > 0) { | ||
this.deps.analytics.reportEvent(EventMetric.SEARCH_BLUR, { |
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.
nit: the same way you have an alias for this.tracUiMetric
we could have an alias of this.deps.analytics.reportEvent
in this.reportEvent
?
const createBatch = (...results: Result[]): GlobalSearchBatchedResults => ({ | ||
results: results.map(createResult), | ||
}); | ||
jest.useFakeTimers({ legacyFakeTimers: true }); |
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 never know if this affects other tests 😊 So I put it in a beforeAll
and then in an afterAll
I call jest. useRealTimers()
... just in case
0330eb2
to
982633d
Compare
Thanks @seb. I agreed with your feedback and have addressed it. Would you mind taking another look? |
💚 Build Succeeded
Metrics [docs]Module Count
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @tsullivan |
Summary
Closes #158880
global_search_bar_click_application
global_search_bar_click_saved_object
global_search_bar_blur
global_search_bar_error
application
: stringsaved_object_type
: stringterms
: stringselected_rank
: numberselected_label
: stringfocus_time_ms
: numbererror_message
NOTE: The "blur" event needs to be created any time the user dismisses the search bar, whether or not a selection has been made. Therefore, the action of a user selecting an option in the global search will yield two separate events.
Checklist
Delete any items that are not applicable to this PR.