-
Notifications
You must be signed in to change notification settings - Fork 3
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 <emilyguo@amazon.com> * two tabs for query insights and configuration Signed-off-by: Emily Guo <emilyguo@amazon.com> * Breadcrumbs + restructuring Signed-off-by: Emily Guo <emilyguo@amazon.com> * Top n queries table + search Signed-off-by: Emily Guo <emilyguo@amazon.com> * search in general Signed-off-by: Emily Guo <emilyguo@amazon.com> * Search includes indices and time selection fully works Signed-off-by: Emily Guo <emilyguo@amazon.com> * Fix tabs display Signed-off-by: Emily Guo <emilyguo@amazon.com> * Basic functionalities of configuration page Signed-off-by: Emily Guo <emilyguo@amazon.com> * Save button + cancel button working Signed-off-by: Emily Guo <emilyguo@amazon.com> * Fixing lint and including relevant files Signed-off-by: Emily Guo <emilyguo@amazon.com> * Typo Signed-off-by: Emily Guo <emilyguo@amazon.com> * ignore lintcache Signed-off-by: Emily Guo <emilyguo@amazon.com> * Delete .eslintcache Signed-off-by: Emily Guo <35637792+LilyCaroline17@users.noreply.github.com> * remove commented out lines Signed-off-by: Emily Guo <emilyguo@amazon.com> * Update based on comments on overview page Signed-off-by: Emily Guo <emilyguo@amazon.com> * Rerun security check? Signed-off-by: Emily Guo <emilyguo@amazon.com> * Added updates to all configurations Signed-off-by: Emily Guo <LilyCaroline1717@gmail.com> * Updated unit test Signed-off-by: Emily Guo <LilyCaroline1717@gmail.com> * Fix based on comments Signed-off-by: Emily Guo <LilyCaroline1717@gmail.com> * Fixed lint issues Signed-off-by: Emily Guo <LilyCaroline1717@gmail.com> * Update TopNQueries.tsx Signed-off-by: Emily Guo <35637792+LilyCaroline17@users.noreply.github.com> * Connected api to frontend Signed-off-by: Emily Guo <LilyCaroline1717@gmail.com> --------- Signed-off-by: Emily Guo <emilyguo@amazon.com> Signed-off-by: Emily Guo <35637792+LilyCaroline17@users.noreply.github.com> Signed-off-by: Emily Guo <LilyCaroline1717@gmail.com>
- 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.