I’d love to see a Jira issue created and a PR opened against https://github.com/apache/solr <https://github.com/apache/solr> for this. Tag me and I’ll review it.
> On Mar 11, 2021, at 6:13 PM, Dwane Hall <dwaneh...@hotmail.com> wrote: > > I dug into this a l little deeper and it looks like some of the metrics > reported from the Metrics API have changed between Solr 7 and 8. The main > culprits seem to be os.totalPhysicalMemorySize not being calucated in Solr 8 > and two missing metrics os.totalSwapSpaceSize and os.freeSwapSpaceSize which > are all used in the Dashboard view page. Below is an extract of the > javascrpit used on the Admin Dashboard, and a comparison between metrics > reported in Solr 7 and 8. The function "parse_memory_value" is where the > javascript error appears to be thrown with the missing metrics. > > Thanks, > > Dwane > > > Solr 8 > > "os.totalPhysicalMemorySize":0, (Not calculated) > > "os.freePhysicalMemorySize":792087998464, > > "os.totalSwapSpaceSize" (Metric not present) > > "os.freeSwapSpaceSize": (Metric not present) > > "memory.heap.committed":8589934592, > > "memory.heap.init":8589934592, > > "memory.heap.max":8589934592, > > "memory.heap.usage":0.006413557566702366, > > "memory.heap.used":55092040, > > "memory.non-heap.committed":97910784, > > "memory.non-heap.init":7667712, > > "memory.non-heap.max":-1, > > "memory.non-heap.usage":-9.2249552E7, > > "memory.non-heap.used":92249712, > > > > Solr 7 > > "os.totalPhysicalMemorySize":810586099712, > > "os.freePhysicalMemorySize":756665888768, > > "os.totalSwapSpaceSize":0, > > "os.freeSwapSpaceSize":0 > > "memory.heap.committed":12348030976, > > "memory.heap.init":12884901888, > > "memory.heap.max":12348030976, > > "memory.heap.usage":0.313836514301922, > > "memory.heap.used":3875263000, > > "memory.non-heap.committed":145039360, > > "memory.non-heap.init":7667712, > > "memory.non-heap.max":-1, > > "memory.non-heap.usage":-1.30145664E8, > > "memory.non-heap.used":130145824, > > > > > > > > main.js (Metrics Dashboard) > > > > // physical memory > > var memoryMax = parse_memory_value(data.system.totalPhysicalMemorySize); > > $scope.memoryTotal = parse_memory_value(data.system.totalPhysicalMemorySize - > data.system.freePhysicalMemorySize); > > $scope.memoryPercentage = ($scope.memoryTotal / memoryMax * 100).toFixed(1)+ > "%"; > > $scope.memoryMax = pretty_print_bytes(memoryMax); > > $scope.memoryTotalDisplay = pretty_print_bytes($scope.memoryTotal); > > > > // swap space > > var swapMax = parse_memory_value(data.system.totalSwapSpaceSize); > > $scope.swapTotal = parse_memory_value(data.system.totalSwapSpaceSize - > data.system.freeSwapSpaceSize); > > $scope.swapPercentage = ($scope.swapTotal / swapMax * 100).toFixed(1)+ "%"; > > $scope.swapMax = pretty_print_bytes(swapMax); > > $scope.swapTotalDisplay = pretty_print_bytes($scope.swapTotal); > > > > // file handles > > $scope.fileDescriptorPercentage = (data.system.openFileDescriptorCount / > data.system.maxFileDescriptorCount *100).toFixed(1) + "%"; > > > > // java memory > > var javaMemoryMax = parse_memory_value(data.jvm.memory.raw.max || > data.jvm.memory.max); > > $scope.javaMemoryTotal = parse_memory_value(data.jvm.memory.raw.total || > data.jvm.memory.total); > > $scope.javaMemoryUsed = parse_memory_value(data.jvm.memory.raw.used || > data.jvm.memory.used); > > $scope.javaMemoryTotalPercentage = ($scope.javaMemoryTotal / javaMemoryMax > *100).toFixed(1) + "%"; > > $scope.javaMemoryUsedPercentage = ($scope.javaMemoryUsed / > $scope.javaMemoryTotal *100).toFixed(1) + "%"; > > $scope.javaMemoryPercentage = ($scope.javaMemoryUsed / javaMemoryMax * > 100).toFixed(1) + "%"; > > $scope.javaMemoryTotalDisplay = pretty_print_bytes($scope.javaMemoryTotal); > > $scope.javaMemoryUsedDisplay = pretty_print_bytes($scope.javaMemoryUsed); // > @todo These should really be an AngularJS Filter: {{ javaMemoryUsed | bytes }} > > $scope.javaMemoryMax = pretty_print_bytes(javaMemoryMax); > > > > > > var parse_memory_value = function( value ) { > > if( value !== Number( value ) ) > > { > > var units = 'BKMGTPEZY'; > > var match = value.match( /^(\d+([,\.]\d+)?) (\w).*$/ ); > > var value = parseFloat( match[1] ) * Math.pow( 1024, units.indexOf( > match[3].toUpperCase() ) ); > > } > > > > return value; > > }; > > > ________________________________ > From: Dwane Hall <dwaneh...@hotmail.com> > Sent: Thursday, 11 March 2021 7:40 PM > To: users@solr.apache.org <users@solr.apache.org> > Subject: Solr Admin Page Metrics > > Hey Solr community. I started playing around with the 8.8.1 docker image > today and noticed issues with the JVM and host memory 'Bar' graphs from the > dashboard page of the Solr Admin interface. It also appeares the "JVM" > parameters were not listed here but definitely configured as expected as they > were visible under the "Java Properties" tab. Form a quick inspection of the > Javascript console it appears some objects were undefined (looks to be an > early Angular application). Has anyone else noticed this behaviour as well > this worked as expected on the 7.x branch of Solr? > > Thanks, > > Dwane > > > DevTools failed to load SourceMap: Could not load content for > https://myhost/solr/libs/angular-resource.min.js.map: HTTP error: status code > 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE > > DevTools failed to load SourceMap: Could not load content for > https://myhost/solr/libs/angular.min.js.map: HTTP error: status code 404, > net::ERR_HTTP_RESPONSE_CODE_FAILURE > > DevTools failed to load SourceMap: Could not load content for > https://myhost/solr/libs/angular-route.min.js.map: HTTP error: status code > 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE > > DevTools failed to load SourceMap: Could not load content for > https://myhost/solr/libs/angular-cookies.min.js.map: HTTP error: status code > 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE > > angular.min.js:146 TypeError: Cannot read property 'match' of undefined > > at parse_memory_value (index.js:80) > > at index.js:43 > > at I (angular-resource.min.js:31) > > at angular.min.js:159 > > at m.$digest (angular.min.js:170) > > at m.$apply (angular.min.js:174) > > at k (angular.min.js:125) > > at v (angular.min.js:130) > > at XMLHttpRequest.y.onload (angular.min.js:131) "Possibly unhandled > rejection: {}" _______________________ Eric Pugh | Founder & CEO | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com <http://www.opensourceconnections.com/> | My Free/Busy <http://tinyurl.com/eric-cal> Co-Author: Apache Solr Enterprise Search Server, 3rd Ed <https://www.packtpub.com/big-data-and-business-intelligence/apache-solr-enterprise-search-server-third-edition-raw> This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such.