Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Metric Collection Examples

Tom Valine edited this page Oct 13, 2016 · 16 revisions

Examples & Screencasts


Argus SDK

This simple example illustrates how to post metrics. The actual metric objects being posted in this example are returned as the result of the createMetricObjects method and not explicitly shown here.

int maxConnections = 10;
try (
    ArgusService service = ArgusService.getInstance(
      "https://argus.mycompany.com/argusws",
      maxConnections)
) {
    service.getAuthService().login("aUsername", "aPassword");
    List<Metric> metrics = createMetricObjects();
    PutResult result = metricService.putMetrics(metrics);
    System.out.println(
      MessageFormat.format(
              "Succeeded: {0}, Failed: {1}.",
              result.getSuccessCount(),
              result.getFailCount()
      )
    );
    service.getAuthService().logout();
}
Clone this wiki locally