File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,16 @@ def get_pricing_info(self) -> ActorPricingInfo:
6464        This can be used for instance when your code needs to support multiple pricing models in transition periods. 
6565        """ 
6666
67+     def  get_charged_event_count (self , event_name : str ) ->  int :
68+         """Get the number of events with the given name that were charged so far. 
69+ 
70+         Args: 
71+             event_name: Name of the inspected event. 
72+         """ 
73+ 
74+     def  get_max_total_charge_usd (self ) ->  Decimal :
75+         """Get the configured maximum total charge for this Actor run.""" 
76+ 
6777
6878@docs_group ('Charging' ) 
6979@dataclass (frozen = True ) 
@@ -309,6 +319,15 @@ def get_pricing_info(self) -> ActorPricingInfo:
309319            },
310320        )
311321
322+     @ensure_context  
323+     def  get_charged_event_count (self , event_name : str ) ->  int :
324+         item  =  self ._charging_state .get (event_name )
325+         return  item .charge_count  if  item  is  not   None  else  0 
326+ 
327+     @ensure_context  
328+     def  get_max_total_charge_usd (self ) ->  Decimal :
329+         return  self ._max_total_charge_usd 
330+ 
312331
313332@dataclass  
314333class  ChargingStateItem :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments