Skip to content

Commit

Permalink
Added new SysMonitorOshi v0 using Oshi library (#14359)
Browse files Browse the repository at this point in the history
Added a new monitor SysMonitorOshi to replace SysMonitor. The new monitor has a wider support for different machine architectures including ARM instances. Please switch to SysMonitorOshi as SysMonitor is now deprecated and will be removed in future releases.
  • Loading branch information
hardikbajaj authored Jun 20, 2023
1 parent f5cc823 commit 1ea9158
Show file tree
Hide file tree
Showing 13 changed files with 1,254 additions and 4 deletions.
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ SOURCE/JAVA-CORE
This product contains lpad and rpad methods adapted from Apache Flink.
* processing/src/main/java/org/apache/druid/java/util/common/StringUtils.java

This product contains SystemInfo methods adapted from oshi
* processing/src/main/java/org/apache/druid/java/util/metrics/OshiSysMonitor.java


MIT License
================================
Expand Down
2 changes: 1 addition & 1 deletion distribution/bin/check-licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def build_compatible_license_names():
compatible_licenses['MIT License'] = 'MIT License'
compatible_licenses['The MIT License (MIT)'] = 'MIT License'
compatible_licenses['Bouncy Castle Licence'] = 'MIT License'
compatible_licenses['SPDX-License-Identifier: MIT'] = 'MIT License'

compatible_licenses['The Go license'] = 'The Go license'

Expand Down Expand Up @@ -435,7 +436,6 @@ def check_licenses(license_yaml, dependency_reports_root):

license_yaml = args.license_yaml
dependency_reports_root = args.dependency_reports_root

check_licenses(license_yaml, dependency_reports_root)

except KeyboardInterrupt:
Expand Down
15 changes: 13 additions & 2 deletions licenses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ name: Java Native Access (JNA)
license_category: binary
module: java-core
license_name: Apache License version 2.0
version: 4.5.1
version: 5.13.0
libraries:
- net.java.dev.jna: jna

Expand Down Expand Up @@ -2341,6 +2341,17 @@ notices:
---

name: OSHI
license_category: binary
module: java-core
license_name: MIT License
version: 6.4.2
libraries:
- com.github.oshi: oshi-core
license_file_path: licenses/bin/oshi.MIT

---

name: JBoss Logging 3
license_category: binary
module: java-core
Expand Down Expand Up @@ -4914,7 +4925,7 @@ libraries:

name: net.java.dev.jna jna-platform
license_category: binary
version: 5.2.0
version: 5.13.0
module: druid-ranger-security
license_name: Apache License version 2.0
libraries:
Expand Down
21 changes: 21 additions & 0 deletions licenses/bin/oshi.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2010-2023 The OSHI Project Contributors: https://github.com/oshi/oshi/graphs/contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
<protobuf.version>3.21.7</protobuf.version>
<resilience4j.version>1.3.1</resilience4j.version>
<slf4j.version>1.7.36</slf4j.version>
<jna.version>5.13.0</jna.version>
<jna-platform.version>5.13.0</jna-platform.version>
<hadoop.compile.version>3.3.5</hadoop.compile.version>
<mockito.version>4.3.1</mockito.version>
<aws.sdk.version>1.12.317</aws.sdk.version>
Expand Down Expand Up @@ -882,7 +884,12 @@
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.5.1</version>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>${jna-platform.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
6 changes: 6 additions & 0 deletions processing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<sigar.base.version>1.6.5</sigar.base.version>
<sigar.version>${sigar.base.version}.132</sigar.version>
<ipaddress.version>5.3.4</ipaddress.version>
<oshi.version>6.4.2</oshi.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -335,6 +336,11 @@
dependency are copied as resources. See maven-dependency-plugin configuration and <resources> below. -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>


<!-- Tests -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.apache.druid.java.util.metrics;

import org.apache.druid.java.util.emitter.service.ServiceEmitter;

public class NoopOshiSysMonitor extends OshiSysMonitor
{
public NoopOshiSysMonitor()
{
super();
}

@Override
public boolean doMonitor(ServiceEmitter emitter)
{
return false;
}
}
Loading

0 comments on commit 1ea9158

Please sign in to comment.