Skip to content

Commit c0f08e9

Browse files
committed
Add integration test for distribution metric submission
1 parent 373044a commit c0f08e9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/integration/api/test_api.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,25 @@ def retry_condition(r):
259259
assert len(metric_query_tuple["series"][0]["pointlist"]) == 1
260260
assert metric_query_tuple["series"][0]["pointlist"][0][1] == 1
261261

262+
def test_distribution_metrics(self):
263+
now = datetime.datetime.now()
264+
now_ts = int(time.mktime(now.timetuple()))
265+
metric_name = "test.distribution_metric." + str(now_ts)
266+
host_name = "test.host." + str(now_ts)
267+
268+
# Send metrics with single and multi points, and with compression
269+
assert dog.Distribution.send(
270+
distributions=[{
271+
'metric': metric_name,
272+
'points': [(now_ts - 60, [1.0])],
273+
'type': 'distribution',
274+
'host': host_name,
275+
}]
276+
)["status"] == "ok"
277+
278+
# FIXME: Query and verify the test metric result. Currently, it takes
279+
# too long for a new distribution metric to become available for query.
280+
262281
def test_graph_snapshot(self):
263282
metric_query = "system.load.1{*}"
264283
event_query = "*"

0 commit comments

Comments
 (0)