Skip to content

Commit 15ce1de

Browse files
committed
wip
1 parent df88618 commit 15ce1de

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/sentry/sentry_metrics/indexer/strings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@
226226
"d:spans/webvital.score.weight.inp@ratio": PREFIX + 416,
227227
"d:spans/webvital.inp@millisecond": PREFIX + 417,
228228
"c:spans/usage@none": PREFIX + 418,
229+
"d:spans/cache.item_size@byte": PREFIX + 419,
229230
# Last possible index: 499
230231
}
231232

tests/snuba/api/endpoints/test_organization_events_stats_span_metrics.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def test_cache_item_size(self):
275275
4,
276276
metric="cache.item_size",
277277
timestamp=self.day_ago + timedelta(minutes=1),
278-
tags={"transaction": "foo", "cache.hit": "true"},
278+
tags={"transaction": "foo"},
279279
)
280280

281281
response = self.do_request(
@@ -287,7 +287,6 @@ def test_cache_item_size(self):
287287
"project": self.project.id,
288288
"dataset": "spansMetrics",
289289
"excludeOther": 0,
290-
"field": ["cache.hit"],
291290
},
292291
)
293292

@@ -298,6 +297,28 @@ def test_cache_item_size(self):
298297
assert not data[0][1][0]["count"]
299298
assert data[1][1][0]["count"] == 4.0
300299

300+
def test_cache_hit(self):
301+
self.store_span_metric(
302+
4,
303+
metric="cache.item_size",
304+
timestamp=self.day_ago + timedelta(minutes=1),
305+
tags={"cache.hit": "true", "transaction": "foo"},
306+
)
307+
308+
response = self.do_request(
309+
data={
310+
"start": iso_format(self.day_ago),
311+
"end": iso_format(self.day_ago + timedelta(minutes=2)),
312+
"interval": "1m",
313+
"field": ["transaction"],
314+
"yAxis": ["count()"],
315+
"project": self.project.id,
316+
"dataset": "spansMetrics",
317+
},
318+
)
319+
320+
assert response.status_code == 200
321+
301322

302323
class OrganizationEventsStatsSpansMetricsEndpointTestWithMetricLayer(
303324
OrganizationEventsStatsSpansMetricsEndpointTest

0 commit comments

Comments
 (0)