-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metric and stat entity #54
Conversation
Codecov Report
@@ Coverage Diff @@
## main #54 +/- ##
============================================
- Coverage 88.82% 88.72% -0.10%
- Complexity 102 130 +28
============================================
Files 15 18 +3
Lines 331 470 +139
Branches 27 35 +8
============================================
+ Hits 294 417 +123
- Misses 33 48 +15
- Partials 4 5 +1
Continue to review full report at Codecov.
|
53be034
to
c173dae
Compare
73a5922
to
b476167
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you define the metrics/stats you are adding in the issue?
src/main/java/org/opensearch/geospatial/action/upload/geojson/Uploader.java
Show resolved
Hide resolved
4cadf39
to
22ac006
Compare
* @return Metric's Identifier | ||
*/ | ||
public String getMetricID() { | ||
return metricID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the metricID?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unique identifier for every upload request
private long failedCount; | ||
private String metricID; | ||
private long successCount; | ||
private long uploadCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these need to be initialized? Seems like metricID at the least should be a required parameter. What happens if this isnt set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now metric id is required now. Default for all others are 0
*/ | ||
public void addMetric(UploadMetric newMetric) { | ||
Objects.requireNonNull(newMetric, "metric cannot be null"); | ||
metrics.add(newMetric); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we check for duplicate metrics anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to HashSet and using metric ID to validate duplicate metrics
eecee09
to
9547c10
Compare
src/main/java/org/opensearch/geospatial/action/upload/geojson/Uploader.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/geospatial/action/upload/geojson/UploadGeoJSONTransportAction.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Override toString to return lowercase. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Since metrics are added to hashset, it doesn't guarante the order anymore. Hence, test metrics individually. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
This type represent the geospatial object it uploaded. Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian <balasvij@amazon.com>
Signed-off-by: Vijayan Balasubramanian balasvij@amazon.com
Description
Following metrics are added for the Upload API
Issues Resolved
#53
Check List
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.