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

David Smiley commented on SOLR-15083:
-------------------------------------

Since it's "just" configuration (some XML file) that is affected that users 
have the ability (and encouraged to) edit, I don't think there's a significant 
backwards compatibility concern... though of course we'd mention this in 
upgrade notes.

My initial preference is fixing the math so that this metric name is true to 
the units of its existing name -- to be in seconds.  On the other hand, I can 
see most (all?) the other times we report are in milliseconds, both for Jetty 
level metrics and Solr ("*.requestTimes"), so maybe we should be consistent?  
CC @ab 

> prometheus-exporter metric solr_metrics_jvm_os_cpu_time_seconds is misnamed
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-15083
>                 URL: https://issues.apache.org/jira/browse/SOLR-15083
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: contrib - prometheus-exporter
>    Affects Versions: 8.6, master (9.0)
>            Reporter: Mathieu Marie
>            Priority: Minor
>              Labels: monitoring, prometheus
>
> *solr_metrics_jvm_os_cpu_time_seconds* metric exported by prometheus-exporter 
> has seconds in its name, however it appears that it is microseconds.
> This name can create confusion when one wants to report it in a dashboard.
>  That metric is defined in 
> [https://github.com/apache/lucene-solr/blob/branch_8_5/solr/contrib/prometheus-exporter/conf/solr-exporter-config.xml#L247]
>  {code}
>           <str>
>             .metrics["solr.jvm"] | to_entries | .[] | select(.key == 
> "os.processCpuTime") as $object |
>             ($object.value / 1000.0) as $value |
>             {
>               name         : "solr_metrics_jvm_os_cpu_time_seconds",
>               type         : "COUNTER",
>               help         : "See following URL: 
> https://lucene.apache.org/solr/guide/metrics-reporting.html";,
>               label_names  : ["item"],
>               label_values : ["processCpuTime"],
>               value        : $value
>             }
>           </str>
> {code}
> In the above config we see that the metric came from  *os.processCpuTime*, 
> which itself came from JMX call 
> [getProcessCpuTime()|https://docs.oracle.com/javase/7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html#getProcessCpuTime()].
> That javadoc says
> {code}
> long getProcessCpuTime()
> Returns the CPU time used by the process on which the Java virtual machine is 
> running in nanoseconds. The returned value is of nanoseconds precision but 
> not necessarily nanoseconds accuracy. This method returns -1 if the the 
> platform does not support this operation.
> Returns:
> the CPU time used by the process in nanoseconds, or -1 if this operation is 
> not supported.
> {code}
> Nanoseconds / 1000 is microseconds.
> Either the name or the computation should be updated.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to