MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / getMetricForValidate

Method getMetricForValidate

test/core/TestTSSubQuery.java:645–656  ·  view source on GitHub ↗

Sets up an object with good, common values for testing the validation function with an "m" type query (no tsuids). Each test can "set" the method it wants to fool with and call .validateAndSetQuery() Warning: This method is also shared by TestTSQuery so be careful if you change any va

()

Source from the content-addressed store, hash-verified

643 * @return A sub query object
644 */
645 public static TSSubQuery getMetricForValidate() {
646 final TSSubQuery sub = new TSSubQuery();
647 sub.setAggregator("sum");
648 sub.setDownsample("5m-avg");
649 sub.setMetric("sys.cpu.0");
650 sub.setRate(false);
651 final HashMap<String, String> tags = new HashMap<String, String>();
652 tags.put("host", "*");
653 tags.put("dc", "lga");
654 sub.setTags(tags);
655 return sub;
656 }
657}

Callers 15

validateMethod · 0.95
validateTSMethod · 0.95
validateNoDSMethod · 0.95
validateNullAggMethod · 0.95
validateEmptyAggMethod · 0.95
validateBadAggMethod · 0.95
validateBadDSMethod · 0.95
validateWithFilterMethod · 0.95

Calls 6

setAggregatorMethod · 0.95
setDownsampleMethod · 0.95
setMetricMethod · 0.95
setRateMethod · 0.95
setTagsMethod · 0.95
putMethod · 0.80

Tested by

no test coverage detected