Skip to content

Commit 7fe4557

Browse files
committed
Moved LOG_PREFIX to StatsControl and changed it to Client stats.
Fixed javadoc.
1 parent a5c0b92 commit 7fe4557

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

driver/src/main/java/oracle/nosql/driver/NoSQLHandleConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.util.logging.Logger;
2121

2222
import oracle.nosql.driver.Region.RegionProvider;
23-
import oracle.nosql.driver.http.StatsControlImpl;
2423
import oracle.nosql.driver.iam.SignatureProvider;
2524

2625
import io.netty.handler.ssl.SslContext;
@@ -1344,7 +1343,7 @@ private void setConfigFromEnvironment() {
13441343
profileProp.toUpperCase()));
13451344
} catch (IllegalArgumentException iae) {
13461345
if (logger != null) {
1347-
logger.log(Level.SEVERE, StatsControlImpl.LOG_PREFIX +
1346+
logger.log(Level.SEVERE, StatsControl.LOG_PREFIX +
13481347
"Invalid profile value for system property " +
13491348
PROFILE_PROPERTY + ": " + profileProp);
13501349
}

driver/src/main/java/oracle/nosql/driver/StatsControl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
*/
8686
public interface StatsControl {
8787

88+
String LOG_PREFIX = "Client stats|";
89+
8890
/**
8991
* The following semantics are attached to the Profile:
9092
* - NONE: no stats are logged.

driver/src/main/java/oracle/nosql/driver/http/Stats.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ private void logClientStats() {
482482
String json = fvStats.toJson(statsControl.getPrettyPrint() ?
483483
JsonOptions.PRETTY : null);
484484
statsControl.getLogger().log(Level.INFO,
485-
StatsControlImpl.LOG_PREFIX + json);
485+
StatsControl.LOG_PREFIX + json);
486486
}
487487

488488
private MapValue generateFieldValueStats() {

driver/src/main/java/oracle/nosql/driver/http/StatsControlImpl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
public class StatsControlImpl
2121
implements StatsControl {
2222

23-
static public final String LOG_PREFIX = "ONJS:Monitoring stats|";
24-
2523
private StatsControl.Profile profile;
2624
private int interval;
2725
private boolean prettyPrint;

driver/src/main/java/oracle/nosql/driver/package-info.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
* At runtime stats collection can be used selectively by using
174174
* {@link oracle.nosql.driver.StatsControl#start()} and
175175
* {@link oracle.nosql.driver.StatsControl#stop()}. The following example shows
176-
* how to use a stats handler:
176+
* how to use a stats handler:</p>
177177
* <pre>
178178
* NoSQLHandleConfig config = new NoSQLHandleConfig( endpoint );
179179
* config.setStatsProfile(StatsControl.Profile.REGULAR);
@@ -208,12 +208,12 @@
208208
*
209209
* // ... application code without stats
210210
* handle.close();
211-
* </pre></p><p>
211+
* </pre><p>
212212
*
213213
* The following is an example of stats log entry using the ALL
214214
* profile:<ol><li>
215215
* A one time entry containing stats id and options:
216-
* <pre>INFO: ONJS:Monitoring stats|{ // INFO log entry
216+
* <pre>INFO: Client stats|{ // INFO log entry
217217
* "sdkName" : "Oracle NoSQL SDK for Java", // SDK name
218218
* "sdkVersion" : "current", // SDK version
219219
* "clientId" : "f595b333", // NoSQLHandle id
@@ -223,7 +223,7 @@
223223
* "rateLimitingEnabled" : false} // if rate limiting is
224224
* enabled</pre></li><li>
225225
* An entry at the end of each interval containing the stats values:
226-
* <pre>INFO: ONJS:Monitoring stats|{
226+
* <pre>INFO: Client stats|{
227227
* "clientId" : "b7bc7734", // id of NoSQLHandle object
228228
* "startTime" : "2021-09-20T20:11:42Z", // UTC start interval time
229229
* "endTime" : "2021-09-20T20:11:47Z", // UTC end interval time

0 commit comments

Comments
 (0)