mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 10:49:00 +00:00 
			
		
		
		
	feat(ingestion): bigquery-usage - Collect stats from read event reasons (#5118)
This commit is contained in:
		
							parent
							
								
									538cfba526
								
							
						
					
					
						commit
						c677a06fd8
					
				| @ -992,6 +992,11 @@ class BigQueryUsageSource(Source): | ||||
|                 if not self._is_table_allowed(event.resource): | ||||
|                     self.report.num_filtered_read_events += 1 | ||||
|                     continue | ||||
| 
 | ||||
|                 if event.readReason: | ||||
|                     self.report.read_reasons_stat[event.readReason] = ( | ||||
|                         self.report.read_reasons_stat.get(event.readReason, 0) + 1 | ||||
|                     ) | ||||
|                 self.report.num_read_events += 1 | ||||
| 
 | ||||
|             missing_query_entry = QueryEvent.get_missing_key_entry(entry) | ||||
|  | ||||
| @ -25,6 +25,9 @@ class BigQueryUsageSourceReport(SourceReport): | ||||
|     log_entry_end_time: Optional[str] = None | ||||
|     num_usage_workunits_emitted: Optional[int] = None | ||||
|     num_operational_stats_workunits_emitted: Optional[int] = None | ||||
|     read_reasons_stat: Counter[str] = dataclasses.field( | ||||
|         default_factory=collections.Counter | ||||
|     ) | ||||
| 
 | ||||
|     def report_dropped(self, key: str) -> None: | ||||
|         self.dropped_table[key] += 1 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tamas Nemeth
						Tamas Nemeth