Skip to content

Commit

Permalink
Merge pull request #48 from thomasgrassauer/master
Browse files Browse the repository at this point in the history
Doc updates + moved tests
  • Loading branch information
thomasgrassauer authored Jan 24, 2018
2 parents 416be4b + 77fce15 commit 26fdaab
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ This repository contains the reference implementation in pure Java. Other implem
* Create Sessions and User Actions
* Report values, events, errors and crashes
* Trace web requests to server-side PurePaths
* Sessions can be tagged with a user tag
* Tag Sessions with a user tag
* Use it together with Dynatrace or AppMon

## What you cannot do with the OpenKit
* Create server-side PurePaths (you have to use an ADK for that)
* Create metrics (you have to use an ADK for that)
* Create server-side PurePaths (this functionality will be provided by OneAgent SDKs)
* Create metrics (this functionality will be provided by OneAgent SDKs)

## Design Principles
* API should be as simple and easy-to-understand as possible
Expand Down Expand Up @@ -152,6 +152,8 @@ OpenKit openKit = new DynatraceOpenKitBuilder(endpointURL, applicationID, device
.withModelID("MyModelID")
.build();

// This call is optional. If waitForInitCompletion is not called, OpenKit
// will be initialized asynchronously.
openKit.waitForInitCompletion();

String clientIP = "8.8.8.8";
Expand All @@ -171,12 +173,6 @@ session.end();
openKit.shutdown();
```


## Known Current Limitations
* problem with SSL keysize > 1024 for Diffie-Hellman (used by Dynatrace) in Java 6 (http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7044060)
* fixed in Java 6u171, which is only available via Oracle support (http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8182231)

## TODOs
* prevent re-entrances e.g. of startup/shutdown
* HTTP optimizations (reuse connection, pool http client?)
* introduce traffic control
11 changes: 8 additions & 3 deletions docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,19 @@ in `isDebugEnabled` and `isInfoEnabled`.
## Initializing OpenKit

When obtaining an OpenKit instance from the OpenKit builder the instance starts an automatic
initialization phase. Since initialization happens asynchronously the application developers
might want to wait until initialization completes, as shown in the example below.
initialization phase. By default, initialization is performed asynchronously.

There might be situations when a developer wants to ensure that initialization is completed before proceeding with
the program logic. For example, short-lived applications where a valid init and shutdown cannot be guaranteed. In
such a case `waitForInitCompletion` can be used.

```java
// wait until the OpenKit instance is fully initialized
boolean success = openKit.waitForInitCompletion();
```

:grey_exclamation: Please refer to the Javadoc for additional information.

The method `waitForInitCompletion` blocks the calling thread until OpenKit is initialized. In case
of misconfiguration this might block the calling thread indefinitely. The return value
indicates whether the OpenKit instance has been initialized or `shutdown` has been called meanwhile.
Expand Down Expand Up @@ -330,4 +335,4 @@ When an OpenKit instance is no longer needed (e.g. the application using OpenKit
obtained instance can be cleared by invoking the `shutdown` method.
Calling the `shutdown` method blocks the calling thread while the OpenKit flushes data which has not been
transmitted yet to the backend (Dynatrace SaaS/Dynatrace Managed/AppMon).
Details are explained in [internals.md](#internals.md)
Details are explained in [internals.md](internals.md)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.dynatrace.openkit.test;
package com.dynatrace.openkit.core.util;

import com.dynatrace.openkit.core.util.DefaultLogger;
import org.junit.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.dynatrace.openkit.test;
package com.dynatrace.openkit.core.util;

import com.dynatrace.openkit.core.util.InetAddressValidator;
import org.junit.Test;
Expand Down

0 comments on commit 26fdaab

Please sign in to comment.