-
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
[Resolver] aria-level and aria-flowto support enhancements #71777
Changes from 1 commit
f59409f
4a1be8d
24c27ee
f72c8e8
64173db
3d2b411
e028c67
e1dd2c2
b7c6246
bcafbec
dfe495f
9662220
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,10 +32,13 @@ export function isTerminatedProcess(passedEvent: ResolverEvent) { | |
* ms since unix epoc, based on timestamp. | ||
* may return NaN if the timestamp wasn't present or was invalid. | ||
*/ | ||
export function datetime(passedEvent: ResolverEvent): number { | ||
export function datetime(passedEvent: ResolverEvent): number | null { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @michaelolo24 when the value isn't defined or can't be parsed this now returns |
||
const timestamp = event.eventTimestamp(passedEvent); | ||
|
||
return timestamp === undefined ? 0 : new Date(timestamp).getTime(); | ||
const time = timestamp === undefined ? 0 : new Date(timestamp).getTime(); | ||
|
||
// if the date could not be parsed, return null | ||
return isNaN(time) ? null : time; | ||
} | ||
|
||
/** | ||
|
@@ -171,3 +174,22 @@ export function argsForProcess(passedEvent: ResolverEvent): string | undefined { | |
} | ||
return passedEvent?.process?.args; | ||
} | ||
|
||
/** | ||
* used to sort events | ||
*/ | ||
export function orderByTime(first: ResolverEvent, second: ResolverEvent): number { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonathan-buttner this now does a tie breaker with an arbitrary comparison of event ID. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! Thanks! |
||
const firstDatetime: number | null = datetime(first); | ||
const secondDatetime: number | null = datetime(second); | ||
|
||
if (firstDatetime === secondDatetime) { | ||
// break ties using an arbitrary (stable) comparison of `eventId` (which should be unique) | ||
return String(event.eventId(first)).localeCompare(String(event.eventId(second))); | ||
} else if (firstDatetime === null || secondDatetime === null) { | ||
// sort `null`'s as higher than numbers | ||
return (firstDatetime === null ? 1 : 0) - (secondDatetime === null ? 1 : 0); | ||
} else { | ||
// sort in ascending order. | ||
return firstDatetime - secondDatetime; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,9 +214,9 @@ export const ProcessEventListNarrowedByType = memo(function ProcessEventListNarr | |
eventCategory: `${eventType}`, | ||
eventType: `${event.ecsEventType(resolverEvent)}`, | ||
name: event.descriptiveName(resolverEvent), | ||
entityId, | ||
entityId: String(entityId), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the behavior here is changed. Before, if the event was a legacy event and the id was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm also the field name here is a bit misleading, we're setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Went to track down what its used for. its not used. removing it. |
||
setQueryParams: () => { | ||
pushToQueryParams({ crumbId: entityId, crumbEvent: processEntityId }); | ||
pushToQueryParams({ crumbId: String(entityId), crumbEvent: processEntityId }); | ||
}, | ||
}; | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ export class PaginationBuilder { | |
const lastResult = results[results.length - 1]; | ||
const cursor = { | ||
timestamp: lastResult['@timestamp'], | ||
eventID: eventId(lastResult), | ||
eventID: String(eventId(lastResult)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the behavior here is changed. Before, if the event was a legacy event and the id was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for point this out. I think we'll want to check if it is |
||
}; | ||
return PaginationBuilder.urlEncodeCursor(cursor); | ||
} | ||
|
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.
@jonathan-buttner this function was converting the serial event id to a string. if it was undefined or 0 it was being converted to
''
. i don't know the reasoning, but i undid it. some BE code was effected. let me know if this is OKThere 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.
@bkimmel or @kqualters-elastic may have thoughts here.
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 this is fine I left some comments about checking for
undefined
and not displaying the string'undefined'
.