-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from oracle/release_2023-11-07
Releasing version 3.3.4.1.3.0
- Loading branch information
Showing
29 changed files
with
1,616 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
hdfs-connector/src/main/java/com/oracle/bmc/hdfs/monitoring/DummyOCIMonitoringPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.oracle.bmc.hdfs.monitoring; | ||
|
||
import com.oracle.bmc.hdfs.store.BmcPropertyAccessor; | ||
import lombok.extern.slf4j.Slf4j; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Slf4j | ||
public class DummyOCIMonitoringPlugin extends OCIMonitorConsumerPlugin { | ||
|
||
private static DummyOCIMonitoringPlugin INSTANCE; | ||
|
||
private List<OCIMetric> ociMetricList = new ArrayList<>(); | ||
|
||
public static DummyOCIMonitoringPlugin getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public DummyOCIMonitoringPlugin(BmcPropertyAccessor propertyAccessor, String bucketName, | ||
String monitoringGroupingID, String namespaceName) { | ||
super(propertyAccessor, bucketName, monitoringGroupingID, namespaceName); | ||
LOG.debug("DummyOCIMonitoringPlugin constructor {} {} {} {}",propertyAccessor, bucketName, | ||
monitoringGroupingID, namespaceName); | ||
} | ||
|
||
@Override | ||
public void accept(OCIMetric ociMetric) { | ||
INSTANCE = this; | ||
|
||
try { | ||
|
||
// Hold on to 100 metric objects for verification in tests and drop them. | ||
if (ociMetricList.size() > 100) { | ||
ociMetricList = new ArrayList<>(); | ||
} | ||
ociMetricList.add(ociMetric); | ||
|
||
LOG.debug("Accepting {} inside accept method of DummyOCIMonitoringPlugin.", ociMetric); | ||
} catch (Exception e) { | ||
// Ignore this exception | ||
} | ||
} | ||
|
||
public List<OCIMetric> getMetrics() { | ||
return ociMetricList; | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
LOG.debug("Inside shutdown method of DummyOCIMonitoringPlugin."); | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
hdfs-connector/src/main/java/com/oracle/bmc/hdfs/monitoring/OCIMetric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package com.oracle.bmc.hdfs.monitoring; | ||
|
||
import com.oracle.bmc.model.BmcException; | ||
|
||
public class OCIMetric { | ||
/** | ||
* The time in milliseconds (epoch) when the metric was recorded. | ||
*/ | ||
private final long recordedTime; | ||
/** | ||
* The overall time taken by the operation to complete/error-out in milliseconds. | ||
*/ | ||
private final double overallTime; | ||
/** | ||
* The operation key. This will be one of {"LIST", "HEAD", "WRITE", "READ", "DELETE", "RENAME"} | ||
*/ | ||
private final String key; | ||
/** | ||
* The boolean error indicates whether the operation errored out. | ||
*/ | ||
private final boolean error; | ||
/** | ||
* If the operation errored out, then the errorStatusCode is populated with the status code of the | ||
* error when communicating with OCI. | ||
*/ | ||
private final int errorStatusCode; | ||
/** | ||
* The target OCI bucket where the operation was attempted to. | ||
*/ | ||
private final String bucketName; | ||
|
||
public OCIMetric(double overallTime, String key, Exception e, String bucketName) { | ||
this.recordedTime = System.currentTimeMillis(); | ||
this.overallTime = overallTime; | ||
this.key = key; | ||
this.bucketName = bucketName; | ||
|
||
int errStatusCode = 0; | ||
if (e != null) { | ||
this.error = true; | ||
if (e instanceof BmcException) { | ||
errStatusCode = ((BmcException) e).getStatusCode(); | ||
} | ||
} else { | ||
this.error = false; | ||
} | ||
this.errorStatusCode = errStatusCode; | ||
} | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
|
||
public double getOverallTime() { | ||
return overallTime; | ||
} | ||
|
||
public boolean isError() { | ||
return error; | ||
} | ||
|
||
public long getRecordedTime() { | ||
return recordedTime; | ||
} | ||
|
||
public String getBucketName() { return bucketName; } | ||
|
||
public int getErrorStatusCode() { return errorStatusCode; } | ||
|
||
@Override | ||
public String toString() { | ||
return "OCIMetric{" + | ||
"recordedTime=" + recordedTime + | ||
", overallTime=" + overallTime + | ||
", key='" + key + '\'' + | ||
", error=" + error + | ||
", bucketName=" + bucketName + | ||
", errorStatusCode=" + errorStatusCode + | ||
'}'; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
hdfs-connector/src/main/java/com/oracle/bmc/hdfs/monitoring/OCIMetricKeys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.oracle.bmc.hdfs.monitoring; | ||
|
||
public class OCIMetricKeys { | ||
public static final String LIST = "LIST"; | ||
public static final String HEAD = "HEAD"; | ||
public static final String WRITE = "WRITE"; | ||
public static final String READ = "READ"; | ||
public static final String DELETE = "DELETE"; | ||
public static final String RENAME = "RENAME"; | ||
} |
24 changes: 24 additions & 0 deletions
24
hdfs-connector/src/main/java/com/oracle/bmc/hdfs/monitoring/OCIMetricWithFBLatency.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.oracle.bmc.hdfs.monitoring; | ||
|
||
public class OCIMetricWithFBLatency extends OCIMetricWithThroughput { | ||
/** | ||
* The time to first byte when a read operation was performed in milliseconds. | ||
*/ | ||
private final double ttfb; | ||
public OCIMetricWithFBLatency(String key, double overallTime, double ttfb, double throughput, Exception e, | ||
double bytesTransferred, String bucketName) { | ||
super(key, overallTime, throughput, e, bytesTransferred, bucketName); | ||
this.ttfb = ttfb; | ||
} | ||
|
||
public double getTtfb() { | ||
return ttfb; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return super.toString() + " OCIMetricWithFBLatency{" + | ||
"ttfb=" + ttfb + | ||
'}'; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
hdfs-connector/src/main/java/com/oracle/bmc/hdfs/monitoring/OCIMetricWithThroughput.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.oracle.bmc.hdfs.monitoring; | ||
|
||
public class OCIMetricWithThroughput extends OCIMetric { | ||
/** | ||
* The throughput that was recorded for the operation in bytes/second | ||
*/ | ||
private final double throughput; | ||
/** | ||
* The total count of bytes that were transferred in or out. | ||
*/ | ||
private final double bytesTransferred; | ||
|
||
public OCIMetricWithThroughput(String key, double overallTime, double throughput, Exception e, | ||
double bytesTransferred, String bucketName) { | ||
super(overallTime, key, e, bucketName); | ||
this.throughput = throughput; | ||
this.bytesTransferred = bytesTransferred; | ||
} | ||
|
||
public double getThroughput() { | ||
return throughput; | ||
} | ||
|
||
public double getBytesTransferred() { return bytesTransferred; } | ||
|
||
@Override | ||
public String toString() { | ||
return super.toString() + " OCIMetricWithThroughput{" + | ||
", throughput=" + throughput + | ||
", bytesTransferred=" + bytesTransferred + | ||
'}'; | ||
} | ||
} |
Oops, something went wrong.