Comments (4)
Can you please pastebin the raw data so I can reproduce the query?
from opentsdb.
The following code inserts the datapoints:
final WritableDataPoints dpAsk = tsdb.newDataPoints();
java.util.Map<String, String> tagsAsk = new HashMap<String, String>(10);
tagsAsk.put("type", "ask");
dpAsk.setSeries("AAA", tagsAsk);
Deferred<Object> d;
d = dpAsk.addPoint(10001001,(float)0.1);
d = dpAsk.addPoint(10002002,(float)0.2);
d = dpAsk.addPoint(10003003,(float)0.3);
final WritableDataPoints dpBid = tsdb.newDataPoints();
java.util.Map<String, String> tagsBid = new HashMap<String, String>(10);
tagsBid.put("type", "bid");
dpBid.setSeries("AAA", tagsBid);
d = dpBid.addPoint(10001011,(float)0.11);
d = dpBid.addPoint(10002022,(float)0.22);
d = dpBid.addPoint(10003033,(float)0.33);
from opentsdb.
Just confirmed this. Setting start time to 0 works or setting it to the row time works, but 100
and some other values don't. Odd.
package net.opentsdb.core;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.stumbleupon.async.Deferred;
import net.opentsdb.utils.Config;
public class SCRATCH {
@Test
public void foo() throws Exception {
TSDB tsdb = new TSDB(new Config(true));
final WritableDataPoints dpAsk = tsdb.newDataPoints();
java.util.Map<String, String> tagsAsk = new HashMap<String, String>(10);
tagsAsk.put("type", "ask");
dpAsk.setSeries("AAA", tagsAsk);
List<Deferred<Object>> deferreds = Lists.newArrayList();
deferreds.add(dpAsk.addPoint(10001001,(float)0.1));
deferreds.add(dpAsk.addPoint(10002002,(float)0.2));
deferreds.add(dpAsk.addPoint(10003003,(float)0.3));
Deferred.group(deferreds).join();
System.out.println("Wrote first set...");
final WritableDataPoints dpBid = tsdb.newDataPoints();
java.util.Map<String, String> tagsBid = new HashMap<String, String>(10);
tagsBid.put("type", "bid");
dpBid.setSeries("AAA", tagsBid);
deferreds.clear();
deferreds.add(dpBid.addPoint(10001011,(float)0.11));
deferreds.add(dpBid.addPoint(10002022,(float)0.22));
deferreds.add(dpBid.addPoint(10003033,(float)0.33));
Deferred.group(deferreds).join();
System.out.println("Wrote second set...");
Map<String, String> tags = Maps.newHashMap();
tags.put("type", "*");
// Query qAAAAny = tsdb.newQuery();
// qAAAAny.setTimeSeries("AAA", tags, null, false);
// qAAAAny.setStartTime(1199);
// qAAAAny.setEndTime(11000000);
// DataPoints[] results = qAAAAny.run();
TSQuery q = new TSQuery();
TSSubQuery sub = new TSSubQuery();
sub.setMetric("AAA");
sub.setTags(tags);
sub.setAggregator("none");
q.setStart("100");
q.setEnd("11000000");
q.setQueries(Lists.newArrayList(sub));
q.validateAndSetQuery();
Query[] queries = q.buildQueries(tsdb);
DataPoints[] results = queries[0].run();
System.out.println("Total results: " + results.length);
for (final DataPoints dps : results) {
SeekableView it = dps.iterator();
while (it.hasNext()) {
DataPoint dp = it.next();
System.out.println(dp.timestamp() + " " + dp.doubleValue());
}
}
}
}
from opentsdb.
Hi @tch,
If your question has been answered, could you please close this issue ?
thanks :)
from opentsdb.
Related Issues (20)
- Solving security vulnerabilities in the dependencies of opentsdb HOT 5
- Custom Retention of metrics HOT 5
- What's a way to obtain the TSUIDs in the database using the OTSBD API? HOT 1
- Feature: Jupysql integration
- Security Contact HOT 2
- Caused by: org.hbase.async.NonRecoverableException: Too many attempts HOT 2
- Where to disclose vulnerabilities HOT 3
- make check failed when opentsdb 2.4.1 test on suse15_aarch64 HOT 1
- Load uid very slowly HOT 2
- NPE on GraphHandler.java when `o` isn't specified as part of the query parameters
- ERROR [ConnectionManager.exceptionCaught] - Unexpected exception from downstream for [] java.lang.OutOfMemoryError: GC overhead limit exceeded
- how to build and run opentsdb
- 3.0 version java.lang.NoClassDefFoundError: com/google/protobuf/AbstractParser when starting tsd
- CVE-2023-25826 HOT 1
- Solving security vulnerabilities in the dependencies of opentsdb
- OpenTSDB - Unable to parse value to a number
- javax.management.loading.MLet deprecated for removal from the JDK
- Skipping exceptions in RegionClient.exceptionCaught HOT 1
- Default GUI username and password? HOT 1
- Replace AsyncHBaseClient with HBase 2 client libraries HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentsdb.