Skip to content

Commit

Permalink
[Synthetics] Fix monitor error duration on Monitor Errors page (elast…
Browse files Browse the repository at this point in the history
…ic#168755)

Fixes elastic#168724 

## Summary

The PR fixes the issue by sorting the data as needed.
  • Loading branch information
awahab07 authored Oct 23, 2023
1 parent 6adb8bd commit 672d8f2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@ export function useMonitorErrors(monitorIdArg?: string) {
(hits[0]?._source as Ping).monitor?.status === 'down' &&
!!errorStates?.length;

const upStatesSortedAsc = upStates.sort(
(a, b) => Number(new Date(a.state.started_at)) - Number(new Date(b.state.started_at))
);

return {
errorStates,
upStates,
upStates: upStatesSortedAsc,
loading,
data,
hasActiveError,
Expand Down

0 comments on commit 672d8f2

Please sign in to comment.