pub struct EventExporterBuilder { /* private fields */ }
Expand description
The builder of the EventExporter
Implementations§
Source§impl EventExporterBuilder
impl EventExporterBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a default Builder, with export_format defaults to ExportFormat::PlainText
Sourcepub fn set_export_format(self, fmt: ExportFormatType) -> Self
pub fn set_export_format(self, fmt: ExportFormatType) -> Self
Set the export format that the ebpf program will export
Sourcepub fn set_export_event_handler(self, handler: Arc<dyn EventHandler>) -> Self
pub fn set_export_event_handler(self, handler: Arc<dyn EventHandler>) -> Self
Set a user-defined event handler callback
Sourcepub fn set_user_context<T: Any>(self, ctx: T) -> Self
pub fn set_user_context<T: Any>(self, ctx: T) -> Self
Set the user-defined context
Sourcepub fn build_for_single_value_with_type_descriptor(
self,
export_type: TypeDescriptor,
btf_container: Arc<BtfContainer>,
intepreter: &BufferValueInterpreter,
) -> Result<Arc<EventExporter>>
pub fn build_for_single_value_with_type_descriptor( self, export_type: TypeDescriptor, btf_container: Arc<BtfContainer>, intepreter: &BufferValueInterpreter, ) -> Result<Arc<EventExporter>>
Build an exporter use TypeDescriptor. Which can easily specify the source to obtain the value type
Sourcepub fn build_for_single_value(
self,
export_type: &ExportedTypesStructMeta,
btf_container: Arc<BtfContainer>,
intepreter: &BufferValueInterpreter,
) -> Result<Arc<EventExporter>>
pub fn build_for_single_value( self, export_type: &ExportedTypesStructMeta, btf_container: Arc<BtfContainer>, intepreter: &BufferValueInterpreter, ) -> Result<Arc<EventExporter>>
Build an EventExporter which is suitable for processing value-only data export_types: The type of the data that kernel program sends. The types will be verified using BTF btf_container: The BTF information
Sourcepub fn build_for_key_value_with_type_desc(
self,
key_export_type: TypeDescriptor,
value_export_type: TypeDescriptor,
sample_config: &MapSampleMeta,
btf_container: Arc<BtfContainer>,
) -> Result<Arc<EventExporter>>
pub fn build_for_key_value_with_type_desc( self, key_export_type: TypeDescriptor, value_export_type: TypeDescriptor, sample_config: &MapSampleMeta, btf_container: Arc<BtfContainer>, ) -> Result<Arc<EventExporter>>
Build an EventExporter, but use TypeDescriptor to indicate where to fetch the value type
Sourcepub fn build_for_key_value(
self,
key_type_id: u32,
value_type_id: u32,
sample_config: &MapSampleMeta,
export_type: &ExportedTypesStructMeta,
btf_container: Arc<BtfContainer>,
) -> Result<Arc<EventExporter>>
pub fn build_for_key_value( self, key_type_id: u32, value_type_id: u32, sample_config: &MapSampleMeta, export_type: &ExportedTypesStructMeta, btf_container: Arc<BtfContainer>, ) -> Result<Arc<EventExporter>>
Build an EventExporter to process sampling map key_type_id: The type id of the map key value_type_id: The type id of the map value sample_config: Detailed configuration of the sampling map export_types: Value types of the map, will be verified btf_container: The btf information