Skip to content

Commit

Permalink
Merge pull request elastic#32 from Elastic-AWP-Platform/bi-directiona…
Browse files Browse the repository at this point in the history
…l-pagination

Bi directional pagination + jump to event support.
  • Loading branch information
mitodrummer committed Jan 19, 2022
2 parents 65844f1 + 2a430b9 commit 7dc497d
Show file tree
Hide file tree
Showing 21 changed files with 2,355 additions and 2,141 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
"react-moment-proptypes": "^1.7.0",
"react-monaco-editor": "^0.41.2",
"react-popper-tooltip": "^2.10.1",
"react-query": "^3.28.0",
"react-query": "^3.34.7",
"react-redux": "^7.2.0",
"react-resizable": "^1.7.5",
"react-resize-detector": "^4.2.0",
Expand Down Expand Up @@ -884,4 +884,4 @@
"yargs": "^15.4.1",
"zlib": "^1.0.5"
}
}
}
2 changes: 1 addition & 1 deletion x-pack/plugins/session_view/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export const RECENT_SESSION_ROUTE = '/internal/session_view/recent_session_route
export const SESSION_ENTRY_LEADERS_ROUTE = '/internal/session_view/session_entry_leaders_route';
export const TEST_SAVED_OBJECT = 'session_view_test_saved_object';

export const PROCESS_EVENTS_PER_PAGE = 2000;
export const PROCESS_EVENTS_PER_PAGE = 1000;
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import {
Process,
ProcessEvent,
ProcessEventsPage,
ProcessFields,
EventAction,
EventKind,
ProcessMap,
User,
} from '../../types/process_tree';

export const mockEvents = [
const mockEvents = [
{
'@timestamp': new Date('2021-11-23T15:25:04.210Z'),
process: {
Expand All @@ -38,11 +39,11 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z')
},
session: {
pid: 2442,
Expand All @@ -54,11 +55,11 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z')
},
entry: {
pid: 2442,
Expand All @@ -70,17 +71,17 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z')
},
command_line: '',
name: '',
args_count: 0,
args: [],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z')
},
event: {
action: EventAction.fork,
Expand Down Expand Up @@ -110,11 +111,11 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
},
session: {
pid: 2442,
Expand All @@ -126,11 +127,11 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
},
entry: {
pid: 2442,
Expand All @@ -142,17 +143,17 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
},
command_line: '',
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.218Z'),
},
event: {
action: EventAction.exec,
Expand Down Expand Up @@ -182,11 +183,11 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.202Z')
},
session: {
pid: 2442,
Expand All @@ -198,11 +199,11 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.202Z')
},
entry: {
pid: 2442,
Expand All @@ -214,13 +215,13 @@ export const mockEvents = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:05.202Z')
},
command_line: '',
start: new Date('2021-11-23T15:25:05.202Z'),
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
Expand All @@ -234,7 +235,7 @@ export const mockEvents = [
},
] as ProcessEvent[];

export const mockAlerts = [
export const mockAlerts: ProcessEvent[] = [
{
kibana: {
alert: {
Expand Down Expand Up @@ -280,11 +281,11 @@ export const mockAlerts = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
},
session: {
pid: 2442,
Expand All @@ -296,11 +297,11 @@ export const mockAlerts = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
},
entry: {
pid: 2442,
Expand All @@ -312,17 +313,17 @@ export const mockAlerts = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args: [],
args_count: 0,
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
},
command_line: '',
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.859Z'),
},
event: {
action: EventAction.exec,
Expand Down Expand Up @@ -375,11 +376,11 @@ export const mockAlerts = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
},
session: {
pid: 2442,
Expand All @@ -391,11 +392,11 @@ export const mockAlerts = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
},
entry: {
pid: 2442,
Expand All @@ -407,17 +408,17 @@ export const mockAlerts = [
executable: '/usr/bin/bash',
interactive: true,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
command_line: '',
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
},
command_line: '',
name: '',
args_count: 2,
args: ['vi', 'cmd/config.ini'],
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:26:34.860Z'),
},
event: {
action: EventAction.exit,
Expand All @@ -427,6 +428,13 @@ export const mockAlerts = [
},
];

export const mockData: ProcessEventsPage[] = [
{
events: mockEvents,
cursor: '2021-11-23T15:25:04.210Z'
}
]

export const processMock: Process = {
id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
events: [],
Expand All @@ -440,30 +448,30 @@ export const processMock: Process = {
hasExec: () => false,
getOutput: () => '',
getDetails: () =>
({
'@timestamp': new Date('2021-11-23T15:25:04.210Z'),
event: {
kind: EventKind.event,
category: 'process',
action: EventAction.exec,
},
process: {
args: [],
args_count: 0,
command_line: '',
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
executable: '',
interactive: false,
name: '',
working_directory: '/home/vagrant',
pid: 1,
pgid: 1,
user: {} as User,
parent: {} as ProcessFields,
session: {} as ProcessFields,
entry: {} as ProcessFields,
},
} as ProcessEvent),
({
'@timestamp': new Date('2021-11-23T15:25:04.210Z'),
event: {
kind: EventKind.event,
category: 'process',
action: EventAction.exec,
},
process: {
args: [],
args_count: 0,
entity_id: '3d0192c6-7c54-5ee6-a110-3539a7cf42bc',
executable: '',
interactive: false,
name: '',
working_directory: '/home/vagrant',
start: new Date('2021-11-23T15:25:04.210Z'),
pid: 1,
pgid: 1,
user: {} as User,
parent: {} as ProcessFields,
session: {} as ProcessFields,
entry: {} as ProcessFields,
},
} as ProcessEvent),
isUserEntered: () => false,
getMaxAlertLevel: () => null,
};
Expand Down
Loading

0 comments on commit 7dc497d

Please sign in to comment.