[ 
https://issues.apache.org/jira/browse/HADOOP-19571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17952443#comment-17952443
 ] 

ASF GitHub Bot commented on HADOOP-19571:
-----------------------------------------

ivandika3 opened a new pull request, #7692:
URL: https://github.com/apache/hadoop/pull/7692

   ### Description of PR
   
   This patch is similar from 
[HDDS-13014](https://issues.apache.org/jira/browse/HDDS-13014). We can add a 
name normalization cache between the Hadoop metrics name and the Prometheus 
metrics name to prevent expensive regex matchings during the metric 
normalization conversion.
   
   ### How was this patch tested?
   
   Simple microbenchmark (see 
https://issues.apache.org/jira/secure/attachment/13076557/TestPrometheusMetricsSinkPerformance.java)
   
   ```
   # With cache
   
   Warming up...
   WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
   WARNING: sun.misc.Unsafe::objectFieldOffset has been called by 
org.apache.hadoop.thirdparty.com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
 
(file:/Users/ivan.andika/.m2/repository/org/apache/hadoop/thirdparty/hadoop-shaded-guava/1.4.0/hadoop-shaded-guava-1.4.0.jar)
   WARNING: Please consider reporting this to the maintainers of class 
org.apache.hadoop.thirdparty.com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
   WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future 
release
   
   Running performance test...
   
   Performance Test Results:
   Total test cases: 5
   Total iterations: 100000
   Total operations: 500000
   Total time: 46.00 ms
   Average time per operation: 0.000 ms
   
   Process finished with exit code 0
   
   # Without cache
   
   Warming up...
   
   Running performance test...
   
   Performance Test Results:
   Total test cases: 5
   Total iterations: 100000
   Total operations: 500000
   Total time: 1181.00 ms
   Average time per operation: 0.002 ms
   ```




> Improve PrometheusMetricsSink#normalizeName performance
> -------------------------------------------------------
>
>                 Key: HADOOP-19571
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19571
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: metrics
>            Reporter: Ivan Andika
>            Priority: Major
>         Attachments: TestPrometheusMetricsSinkPerformance.java
>
>
> This patch is similar from HDDS-13014. We can add a name normalization cache 
> between the Hadoop metrics name and the Prometheus metrics name to prevent 
> expensive regex matchings during the metric normalization conversion.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to