File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -330,7 +330,32 @@ mod tests {
330330 }
331331
332332 #[ test]
333- fn test_find_metric_origin_azure_functions ( ) {
333+ fn test_find_metric_origin_azure_functions_enhanced ( ) {
334+ let tags = SortedTags :: parse ( "origin:azurefunction" ) . unwrap ( ) ;
335+ let metric = Metric {
336+ id : 0 ,
337+ name : "azure.functions.enhanced.cpu.usage" . into ( ) ,
338+ value : MetricValue :: Gauge ( 1.0 ) ,
339+ tags : Some ( tags. clone ( ) ) ,
340+ timestamp : 0 ,
341+ } ;
342+ let origin = metric. find_origin ( tags) . unwrap ( ) ;
343+ assert_eq ! (
344+ origin. origin_product as u32 ,
345+ OriginProduct :: Serverless as u32
346+ ) ;
347+ assert_eq ! (
348+ origin. origin_category as u32 ,
349+ OriginCategory :: AzureFunctionsMetrics as u32
350+ ) ;
351+ assert_eq ! (
352+ origin. origin_service as u32 ,
353+ OriginService :: ServerlessEnhanced as u32
354+ ) ;
355+ }
356+
357+ #[ test]
358+ fn test_find_metric_origin_azure_functions_custom ( ) {
334359 let tags = SortedTags :: parse ( "origin:azurefunction" ) . unwrap ( ) ;
335360 let metric = Metric {
336361 id : 0 ,
You can’t perform that action at this time.
0 commit comments