HDDS-15147. Improve Recon Datanode Insight export: filename, size unit#10177
HDDS-15147. Improve Recon Datanode Insight export: filename, size unit#10177navinko wants to merge 6 commits intoapache:masterfrom
Conversation
…lenames and Unit Headers
sreejasahithi
left a comment
There was a problem hiding this comment.
Thanks @navinko , left few minor comments
| String timestamp = LocalDateTime.now().format(formatter); | ||
|
|
||
| // Retrieve clusterId from ReconContext | ||
| String clusterName = "UnknownCluster"; |
There was a problem hiding this comment.
nit : better to name is as ClusterID
There was a problem hiding this comment.
Done , used clusterID instead of ClusterID bcz checkstyle validations warns for non camel case.
"Name 'ClusterID' must match pattern '^[a-z][a-zA-Z0-9]*$'.""
| ); | ||
|
|
||
| return ReconUtils.downloadCsv("datanode_storage_and_pending_deletion_stats.csv", headers, data, columns); | ||
| DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HHmm"); |
There was a problem hiding this comment.
This can be made to a private static final field in the class
| v -> v.getReport() != null ? formatBytesToGB(v.getReport().getCommitted()) : -1, | ||
| v -> v.getReport() != null ? formatBytesToGB(v.getReport().getReserved()) : -1, | ||
| v -> v.getReport() != null ? formatBytesToGB(v.getReport().getMinimumFreeSpace()) : -1, | ||
| v -> v.getReport() != null ? formatBytesToGB(v.getMetric().getPendingBlockSize()) : -1 |
There was a problem hiding this comment.
Here for getting PendingBlockSize it would be better if add a guard for v.getMetric() != null since we are reading the value form the metric.
There was a problem hiding this comment.
done , good catch ..It was missed across prev reviews as well.
|
@arunsarin85 @navinko |
|
Thanks @priyeshkaratha i do agree with you. |
@priyeshkaratha Agreed ! Keeping it in bytes makes more sense. |
|
Thanks @priyeshkaratha for review. Addressed review comments . |
What changes were proposed in this pull request?
Fomat used: Datanode_Insights_ClusterId_timestamp
Example: Datanode_Insights_CID-ec3d0c23-7863-4f94-9e48-78134b891a62_20260502_1115.csv
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-15147
How was this patch tested?
Verified with updated unit test class and dev tool downloaded filename.
Datanode_Insights_CID-6ece86f7-d869-411e-832c-1dad626c0991_20260505_1314.csv
Successful CI : https://github.com/navinko/ozone/actions/runs/25384413555