Skip to content

Java language bindings for the AppOptics API

License

Notifications You must be signed in to change notification settings

appoptics/appoptics-api-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appoptics-api-java

Java language bindings for the AppOptics Metrics API.

Maven Dependency

Find the latest version here.

<dependency>
    <groupId>com.appoptics.metrics</groupId>
    <artifactId>appoptics-api-java</artifactId>
    <version>1.0.2</version>
</dependency>

Setup

You must first initialize the client:

AppopticsClient client = AppopticsClient.builder(apiToken)
    // these are optional
    .setConnectTimeout(new Duration(5, SECONDS))
    .setReadTimeout(new Duration(5, SECONDS))
    .setAgentIdentifier("my app name")
    // and finally build
    .build();

Once your client has been built, you can submit measures to the AppOptics API:

PostMeasuresResult result = client.postMeasures(new Measures()
    .add(new Measure(name, value, tag, tag))
    .add(new Measure(name, sum, count, min, max, tag, tag ,tag)));

for (PostResult postResult : result.results) {
    if (result.isError()) {
        log.error(result.toString);
    }
}

About

Java language bindings for the AppOptics API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages