()
| 171 | } |
| 172 | |
| 173 | @Test |
| 174 | public void runLongTwoGroup() throws Exception { |
| 175 | storeLongTimeSeriesSeconds(true, false); |
| 176 | |
| 177 | tags.clear(); |
| 178 | tags.put(TAGK_STRING , "*"); |
| 179 | query.setStartTime(1356998400); |
| 180 | query.setEndTime(1357041600); |
| 181 | query.setTimeSeries(METRIC_STRING, tags, Aggregators.SUM, false); |
| 182 | |
| 183 | final DataPoints[] dps = query.run(); |
| 184 | assertMeta(dps, 0, false); |
| 185 | assertMeta(dps, 1, false); |
| 186 | assertEquals(2, dps.length); |
| 187 | |
| 188 | int value = 1; |
| 189 | long timestamp = 1356998430000L; |
| 190 | for (DataPoint dp : dps[0]) { |
| 191 | assertEquals(value, dp.longValue()); |
| 192 | assertEquals(timestamp, dp.timestamp()); |
| 193 | value++; |
| 194 | timestamp += 30000; |
| 195 | } |
| 196 | assertEquals(300, dps[0].size()); |
| 197 | |
| 198 | value = 300; |
| 199 | timestamp = 1356998430000L; |
| 200 | for (DataPoint dp : dps[1]) { |
| 201 | assertEquals(value, dp.longValue()); |
| 202 | assertEquals(timestamp, dp.timestamp()); |
| 203 | value--; |
| 204 | timestamp += 30000; |
| 205 | } |
| 206 | assertEquals(300, dps[1].size()); |
| 207 | } |
| 208 | |
| 209 | @Test |
| 210 | public void runLongSingleTSRate() throws Exception { |
nothing calls this directly
no test coverage detected