-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add partitioning to log rate results API
- Loading branch information
Showing
17 changed files
with
1,023 additions
and
547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
x-pack/legacy/plugins/infra/public/containers/logs/log_analysis/api/get_log_entry_rate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { fold } from 'fp-ts/lib/Either'; | ||
import { pipe } from 'fp-ts/lib/pipeable'; | ||
import { identity } from 'fp-ts/lib/function'; | ||
import { kfetch } from 'ui/kfetch'; | ||
|
||
import { | ||
getLogEntryRateRequestPayloadRT, | ||
getLogEntryRateSuccessReponsePayloadRT, | ||
LOG_ANALYSIS_GET_LOG_ENTRY_RATE_PATH, | ||
} from '../../../../../common/http_api/log_analysis'; | ||
import { createPlainError, throwErrors } from '../../../../../common/runtime_types'; | ||
|
||
export const callGetLogEntryRateAPI = async ( | ||
sourceId: string, | ||
startTime: number, | ||
endTime: number, | ||
bucketDuration: number | ||
) => { | ||
const response = await kfetch({ | ||
method: 'POST', | ||
pathname: LOG_ANALYSIS_GET_LOG_ENTRY_RATE_PATH, | ||
body: JSON.stringify( | ||
getLogEntryRateRequestPayloadRT.encode({ | ||
data: { | ||
sourceId, | ||
timeRange: { | ||
startTime, | ||
endTime, | ||
}, | ||
bucketDuration, | ||
}, | ||
}) | ||
), | ||
}); | ||
return pipe( | ||
getLogEntryRateSuccessReponsePayloadRT.decode(response), | ||
fold(throwErrors(createPlainError), identity) | ||
); | ||
}; |
71 changes: 0 additions & 71 deletions
71
...gins/infra/public/containers/logs/log_analysis/log_analysis_graph_data/log_entry_rate.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
x-pack/legacy/plugins/infra/public/pages/logs/analysis/chart_helpers/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.