risingwave_license/
lib.rs1#![feature(let_chains)]
16
17mod cpu;
18mod feature;
19mod key;
20mod manager;
21
22pub use feature::*;
23pub use key::*;
24pub use manager::*;
25use risingwave_pb::telemetry::PbTelemetryEventStage;
26use risingwave_telemetry_event::report_event_common;
27
28pub(crate) fn report_telemetry(feature: &Feature, feature_name: &str, success_flag: bool) {
29 if !matches!(feature, Feature::TestPaid) {
30 let mut attr_builder = jsonbb::Builder::<Vec<u8>>::new();
31 attr_builder.begin_object();
32 attr_builder.add_string("success");
33 attr_builder.add_value(jsonbb::ValueRef::Bool(success_flag));
34 attr_builder.end_object();
35 let attr = attr_builder.finish();
36
37 report_event_common(
38 PbTelemetryEventStage::Unspecified,
39 feature_name,
40 0,
41 None,
42 None,
43 Some(attr),
44 "paywall".to_owned(),
45 );
46 }
47}