Skip to content

Create writer file only if metrics are present#23

Merged
sruti1312 merged 6 commits intomainfrom
feature/writer-files
Jul 15, 2021
Merged

Create writer file only if metrics are present#23
sruti1312 merged 6 commits intomainfrom
feature/writer-files

Conversation

@sruti1312
Copy link
Copy Markdown
Contributor

@sruti1312 sruti1312 commented Jun 29, 2021

Signed-off-by: Sruti Parthiban partsrut@amazon.com

Is your feature request related to a problem? Please provide an existing Issue # , or describe.
opensearch-project/performance-analyzer#30

Describe the solution you are proposing
Before renaming the tmp writer file to epoch writer files, check if tmp file exists before we create the writer file.
This will help with not having empty writer file.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Sruti Parthiban <partsrut@amazon.com>
@sruti1312 sruti1312 requested a review from khushbr July 2, 2021 00:16
@sruti1312 sruti1312 force-pushed the feature/writer-files branch from 9c7de4c to 253cf64 Compare July 2, 2021 18:40
Signed-off-by: Sruti Parthiban <partsrut@amazon.com>
@sruti1312 sruti1312 force-pushed the feature/writer-files branch from 253cf64 to 5c56924 Compare July 2, 2021 18:41
@sruti1312 sruti1312 requested a review from khushbr July 2, 2021 18:42
khushbr
khushbr previously approved these changes Jul 2, 2021
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #23 (f6cbc5e) into main (1ee100d) will decrease coverage by 0.10%.
The diff coverage is 27.27%.

❗ Current head f6cbc5e differs from pull request most recent head 5c56924. Consider uploading reports for the commit 5c56924 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##               main      #23      +/-   ##
============================================
- Coverage     76.89%   76.79%   -0.11%     
+ Complexity     3182     3173       -9     
============================================
  Files           368      368              
  Lines         18366    18372       +6     
  Branches       1396     1397       +1     
============================================
- Hits          14123    14109      -14     
- Misses         3748     3764      +16     
- Partials        495      499       +4     
Impacted Files Coverage Δ
...yzer/reader_writer_shared/EventLogFileHandler.java 37.31% <11.11%> (-2.37%) ⬇️
...eanalyzer/rca/framework/metrics/WriterMetrics.java 86.48% <100.00%> (+0.77%) ⬆️
.../rca/store/rca/util/NodeConfigCacheReaderUtil.java 80.00% <0.00%> (-15.00%) ⬇️
...nalyzer/rca/net/handler/PublishRequestHandler.java 75.60% <0.00%> (-7.32%) ⬇️
...ensearch/performanceanalyzer/CertificateUtils.java 84.74% <0.00%> (-6.78%) ⬇️
...zer/decisionmaker/deciders/QueueHealthDecider.java 76.00% <0.00%> (-6.00%) ⬇️
...manceanalyzer/decisionmaker/deciders/Decision.java 70.58% <0.00%> (-5.89%) ⬇️
...cisionmaker/actions/ModifyQueueCapacityAction.java 85.41% <0.00%> (-4.17%) ⬇️
...ormanceanalyzer/rca/store/rca/cache/CacheUtil.java 61.29% <0.00%> (-3.23%) ⬇️
...ensearch/performanceanalyzer/hwnet/NetworkE2E.java 77.47% <0.00%> (-1.81%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ee100d...5c56924. Read the comment docs.

Copy link
Copy Markdown

@yojs yojs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a test to make sure we cover all the cases.

metrics in queue tmp file exists Action
no no Do nothing (Sounds fishy as this means collectors didn't run at all).
no no rename the tmp file to currrent timestamp (This also means no collectors ran since last time)
yes no write metrics file
yes yes rename the old tmp file to current and then add/append the new metrics emitted since.

@sruti1312
Copy link
Copy Markdown
Contributor Author

Added tests as a part of this PR:
opensearch-project/performance-analyzer#35

khushbr
khushbr previously approved these changes Jul 13, 2021
Signed-off-by: Sruti Parthiban <partsrut@amazon.com>
@sruti1312 sruti1312 merged commit 46e9127 into main Jul 15, 2021
@sruti1312 sruti1312 deleted the feature/writer-files branch July 15, 2021 22:19
@sruti1312 sruti1312 added the bug Something isn't working label Jul 15, 2021
sruti1312 added a commit that referenced this pull request Aug 25, 2021
* Adding the initial changes for purger fix

* Removing deletionInterval from MetricConfig class

* Moving the removeMetrics() back to PerformanceAnalyzerMetrics class

* Adding Event log file deletion + deletion time metric

* Updating the EventLogFilesDeleted metrics

* Moving METRICS_WRITE_ERROR metric to Named Counter, updating deleteFiles() signature

* nit: Removing an unused import

* Addressing the spotbug failure

* Fixing the linker error, updating from docs-beta to official documentation

* Excluding https://www.envoyproxy.io/ from link checker. Failing with too many redirects

* Create writer file only if metrics are present (#23)

* Create writer file only if metrics are present

Signed-off-by: Sruti Parthiban <partsrut@amazon.com>

* Add metrics to writers metric

* Rename writer_file_creation metric name

Signed-off-by: Sruti Parthiban <partsrut@amazon.com>

* Update the statistic for the metric

* Spotless changes

Signed-off-by: Sruti Parthiban <partsrut@amazon.com>

* Add privileges for removing files (#45)

Signed-off-by: Sruti Parthiban <partsrut@amazon.com>

* Remove spotless dependency on main (#54)

This PR removes the need for the main branch to be checked out
in order to build.

Signed-off-by: Marc Handalian <handalm@amazon.com>

* Upgrade to version 1.0.1

Co-authored-by: Khushboo Rajput <khushbr@amazon.com>
Co-authored-by: Khushboo Rajput <59671881+khushbr@users.noreply.github.com>
Co-authored-by: Marc Handalian <handalm@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants