File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change 11import  {  Context  }  from  '../context' ; 
22
3- type  MetricType  =  'counter'  |  'gauge'  |  'histogram' ; 
43type  LabelValuesKey  =  string ; 
54
65function  getLabelKey ( labels ?: MetricLabels ) : LabelValuesKey  { 
@@ -41,12 +40,19 @@ const isNumericMetricSample = (sample: MetricSample): sample is NumericMetricSam
4140const  isBucketMetricSample  =  ( sample : MetricSample ) : sample  is BucketMetricSample  => 
4241  'buckets'  in  sample ; 
4342
44- export  interface  CollectedMetric  { 
45-   name : string ; 
46-   help : string ; 
47-   type : MetricType ; 
48-   samples : MetricSample [ ] ; 
49- } 
43+ export  type  CollectedMetric  = 
44+   |  { 
45+       name : string ; 
46+       help : string ; 
47+       type : 'counter'  |  'gauge' ; 
48+       samples : NumericMetricSample [ ] ; 
49+     } 
50+   |  { 
51+       name : string ; 
52+       help : string ; 
53+       type : 'histogram' ; 
54+       samples : BucketMetricSample [ ] ; 
55+     } ; 
5056
5157interface  CollectibleMetric  { 
5258  collect ( ) : CollectedMetric ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments