-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a high-level overview of classes in the repository (#588)
* add docs Signed-off-by: Kartavya Vashishtha <[email protected]> * rename to overview Signed-off-by: Kartavya Vashishtha <[email protected]> * use newer architecture photo in reader.md Signed-off-by: Kartavya Vashishtha <[email protected]> --------- Signed-off-by: Kartavya Vashishtha <[email protected]>
- Loading branch information
Showing
4 changed files
with
36 additions
and
4 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,30 @@ | ||
In `src/main/java/org/opensearch/performanceanalyzer/`: | ||
|
||
- `PerformanceAnalyzerPlugin`'s constructor does the following: | ||
1. Creates a `scheduledMetricCollectorsExecutor`. | ||
2. `scheduledMetricCollectorsExecutor.addScheduledMetricCollector(new XYZMetricsCollector())` is called for all collectors. | ||
3. `scheduledMetricCollectorsExecutor.start()` is called and then `EventLogQueueProcessor.scheduleExecutor()`. | ||
|
||
- Methods in `PerformanceAnalyzerPlugin` interface with the OpenSearch plugin architecture | ||
- `onIndexModule`, `onDiscovery`, etc. are all called by OpenSearch when their corresponding events occur and the plugin can act on them. | ||
- For example: | ||
- `getActionFilters` provides OpenSearch with a list of classes that implement `ActionFilter`. | ||
- `action/PerformanceAnalyzerActionFilter` is the only class currently returned to OpenSearch as an `ActionFilter`. | ||
- when a BulkRequest or SearchRequest is recieved by OpenSearch, `action/PerformanceAnalyzerActionFilter` logs a start event and creates a listener (`action/PerformanceAnalyzerActionListener`) which waits to record the corresponding end event. | ||
- `PerformanceAnalyzerPlugin.getRestHandlers` returns all the classes that can handle REST requests to OpenSearch. | ||
- The classes in `http_action/config` define all the public API routes for Performance Analyzer. | ||
- `http_action/config/RestConfig` defines `PA_BASE_URI = "/_plugins/_performanceanalyzer"` | ||
- `PerformanceAnalyzerResourceProvider` defines the `metrics`, `rca`, `batch` and `actions` routes. | ||
- `PerformanceAnalyzerResourceProvider.SUPPORTED_REDIRECTIONS = ("rca", "metrics", "batch", "actions")` | ||
- `listener/PerformanceAnalyzerSearchListener` hooks into OpenSearch core to emit search operation related metrics. | ||
|
||
|
||
- `writer/EventLogQueueProcessor`: | ||
- contains `purgeQueueAndPersist` which drains `PerformanceAnalyzerMetrics.metricQueue` into a file that contains all events for a certain time bucket. It also removes old events. Uses `event_process.EventLogFileHandler` in Performance Analyzer Commons for file writing logic. | ||
- `scheduleExecutor` periodically runs `purgeQueueAndPersist`. | ||
|
||
- Classes in `collectors` extend `PerformanceAnalyzerMetricsCollector` and implement `MetricsProcessor`. | ||
- `PerformanceAnalyzerMetricsCollector` implements `Runnable` and contains common variables like `value` where a collector stores serialized metrics. | ||
- A collector is triggered through `PerformanceAnalyzerMetricsCollector.collectMetrics`. | ||
1. The collector will store serialized data in the `value` variable and then call `MetricsProcessor.saveMetricValues`. | ||
2. `saveMetricValues` calls `PerformanceAnalyzerMetrics.emitMetric` that creates an `Event` from the serialized data and adds it to a static queue (`PerformanceAnalyzerMetrics.metricQueue`) shared across all collectors. |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.