opentsdb-java-client icon indicating copy to clipboard operation
opentsdb-java-client copied to clipboard

The method pushMetrics(MetricBuilder, ExpectResponse) from the type HttpClient refers to the missing type Response

Open vinsmvk opened this issue 8 years ago • 0 comments

This is the error i am getting..The method pushMetrics(MetricBuilder, ExpectResponse) from the type HttpClient refers to the missing type Response. on the method pushMetrics().

this is my code.. package com.opentsdb;

import src.main.java.org.opentsdb.client.response.*;

import src.main.java.org.opentsdb.client.ExpectResponse;

//import src.main.java.org.opentsdb.client.response.Response;

//import src.main.java.org.opentsdb.client.ExpectResponse;

import src.main.java.org.opentsdb.client.*; import src.main.java.org.opentsdb.client.HttpClientImpl; import src.main.java.org.opentsdb.client.builder.MetricBuilder;

public class OpenTSDBExampl {

public static void main(String[] args) {

	HttpClient client = new HttpClientImpl("http://localhost:4242"); 
	
	MetricBuilder builder = MetricBuilder.getInstance();
	
	builder.addMetric("sys.cpu.user").setDataPoint(2, 30l).addTag("vins", "255").addTag("vins2", "150");
	builder.addMetric("sys.cpu.user2").setDataPoint(2, 30l).addTag("vins3", "255").addTag("vins4", "150");
	try
	{
		Response response = client.pushMetrics(builder, ExpectResponse.SUMMARY);
		System.out.println(response);
	}
	catch (Exception e) {
		// TODO: handle exception
		e.printStackTrace();
	}
}

} screenshot from 2017-05-09 15-41-25

vinsmvk avatar May 09 '17 10:05 vinsmvk