-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Top n queries connected to api (#10)
* Add 2 tabs to home screen Signed-off-by: Emily Guo <[email protected]> * two tabs for query insights and configuration Signed-off-by: Emily Guo <[email protected]> * Breadcrumbs + restructuring Signed-off-by: Emily Guo <[email protected]> * Top n queries table + search Signed-off-by: Emily Guo <[email protected]> * search in general Signed-off-by: Emily Guo <[email protected]> * Search includes indices and time selection fully works Signed-off-by: Emily Guo <[email protected]> * Fix tabs display Signed-off-by: Emily Guo <[email protected]> * Basic functionalities of configuration page Signed-off-by: Emily Guo <[email protected]> * Save button + cancel button working Signed-off-by: Emily Guo <[email protected]> * Fixing lint and including relevant files Signed-off-by: Emily Guo <[email protected]> * Typo Signed-off-by: Emily Guo <[email protected]> * ignore lintcache Signed-off-by: Emily Guo <[email protected]> * Delete .eslintcache Signed-off-by: Emily Guo <[email protected]> * remove commented out lines Signed-off-by: Emily Guo <[email protected]> * Update based on comments on overview page Signed-off-by: Emily Guo <[email protected]> * Rerun security check? Signed-off-by: Emily Guo <[email protected]> * Added updates to all configurations Signed-off-by: Emily Guo <[email protected]> * Updated unit test Signed-off-by: Emily Guo <[email protected]> * Fix based on comments Signed-off-by: Emily Guo <[email protected]> * Fixed lint issues Signed-off-by: Emily Guo <[email protected]> * Update TopNQueries.tsx Signed-off-by: Emily Guo <[email protected]> * Connected api to frontend Signed-off-by: Emily Guo <[email protected]> --------- Signed-off-by: Emily Guo <[email protected]> Signed-off-by: Emily Guo <[email protected]> Signed-off-by: Emily Guo <[email protected]>
- Loading branch information
1 parent
afe9a0c
commit 405f5e7
Showing
4 changed files
with
435 additions
and
20 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
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,83 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const QueryInsightsPlugin = function (Client, config, components) { | ||
const ca = components.clientAction.factory; | ||
Client.prototype.queryInsights = components.clientAction.namespaceFactory(); | ||
const queryInsights = Client.prototype.queryInsights.prototype; | ||
|
||
queryInsights.getTopNQueries = ca({ | ||
url: { | ||
fmt: `/_insights/top_queries`, | ||
}, | ||
method: 'GET', | ||
}); | ||
|
||
queryInsights.getTopNQueriesLatency = ca({ | ||
url: { | ||
fmt: `/_insights/top_queries?type=latency&from=<%=from%>&to=<%=to%>`, | ||
req: { | ||
from: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
to: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
}, | ||
}, | ||
method: 'GET', | ||
}); | ||
|
||
queryInsights.getTopNQueriesCpu = ca({ | ||
url: { | ||
fmt: `/_insights/top_queries?type=cpu&from=<%=from%>&to=<%=to%>`, | ||
req: { | ||
from: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
to: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
}, | ||
}, | ||
method: 'GET', | ||
}); | ||
|
||
queryInsights.getTopNQueriesMemory = ca({ | ||
url: { | ||
fmt: `/_insights/top_queries?type=memory&from=<%=from%>&to=<%=to%>`, | ||
req: { | ||
from: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
to: { | ||
type: 'string', | ||
required: true, | ||
}, | ||
}, | ||
}, | ||
method: 'GET', | ||
}); | ||
|
||
queryInsights.getSettings = ca({ | ||
url: { | ||
fmt: `_cluster/settings?include_defaults=true`, | ||
}, | ||
method: 'GET', | ||
}); | ||
|
||
queryInsights.setSettings = ca({ | ||
url: { | ||
fmt: `_cluster/settings`, | ||
}, | ||
method: 'PUT', | ||
needBody: true, | ||
}); | ||
}; |
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.