File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ def __init__(
5151 def get_requests (self , metric_name : str ) -> Dict [uuid .UUID , BaseMetricRequest ]:
5252 """Get all requests for a specific metric."""
5353 with self ._requests_lock :
54- return self .requests .get (metric_name , {})
54+ return dict ( self .requests .get (metric_name , {}) )
5555
5656 def get_all_requests_flat (self ) -> Dict [uuid .UUID , BaseMetricRequest ]:
5757 """Get all requests across all metrics as a flat dictionary."""
Original file line number Diff line number Diff line change 11import threading
22import uuid
3+ from typing import Dict
34from unittest .mock import Mock , patch
45
56import pandas as pd
67import pytest
78from prometheus_client import CollectorRegistry , generate_latest
89from src .service .data .datasources .data_source import DataSource
10+ from src .service .payloads .metrics .base_metric_request import BaseMetricRequest
911from src .service .prometheus .metric_value_carrier import MetricValueCarrier
1012from src .service .prometheus .prometheus_publisher import PrometheusPublisher
11-
1213from src .service .prometheus .prometheus_scheduler import PrometheusScheduler
13- from tests .service .prometheus .test_prometheus_publisher import MockMetricRequest
14+
15+
16+ class MockMetricRequest (BaseMetricRequest ):
17+ """Mock implementation of BaseMetricRequest for testing."""
18+
19+ def __init__ (
20+ self , model_id : str = "test_model" , metric_name : str = "test_metric"
21+ ) -> None :
22+ super ().__init__ (
23+ model_id = model_id ,
24+ metric_name = metric_name ,
25+ request_name = "test_request" ,
26+ batch_size = 100 ,
27+ )
28+
29+ def retrieve_tags (self ) -> Dict [str , str ]:
30+ return {"custom_tag" : "custom_value" }
1431
1532
1633class TestPrometheusScheduler :
You can’t perform that action at this time.
0 commit comments