pub struct InterestMetrics {
pub top_single_interest_similarity: u32,
pub top_2interest_similarity: u32,
pub top_3interest_similarity: u32,
}
Expand description
Interest metrics that we want to send to Glean as part of the validation process. These contain the cosine similarity when comparing the user’s interest against various interest vectors that consumers may use.
Cosine similarly was chosen because it seems easy to calculate. This was then matched against some semi-plausible real-world interest vectors that consumers might use. This is all up for debate and we may decide to switch to some other metrics.
Similarity values are transformed to integers by multiplying the floating point value by 1000 and rounding. This is to make them compatible with Glean’s distribution metrics.
Fields§
§top_single_interest_similarity: u32
Similarity between the user’s interest vector and an interest vector where the element for the user’s top interest is copied, but all other interests are set to zero. This measures the highest possible similarity with consumers that used interest vectors with a single interest set.
top_2interest_similarity: u32
The same as before, but the top 2 interests are copied. This measures the highest possible similarity with consumers that used interest vectors with a two interests (note: this means they would need to choose the user’s top two interests and have the exact same proportion between them as the user).
top_3interest_similarity: u32
The same as before, but the top 3 interests are copied.
Trait Implementations§
source§impl<UT> ConvertError<UT> for InterestMetrics
impl<UT> ConvertError<UT> for InterestMetrics
fn try_convert_unexpected_callback_error( e: UnexpectedUniFFICallbackError, ) -> Result<Self>
source§impl<UT> FfiConverter<UT> for InterestMetrics
impl<UT> FfiConverter<UT> for InterestMetrics
source§const TYPE_ID_META: MetadataBuffer = _
const TYPE_ID_META: MetadataBuffer = _
source§type FfiType = RustBuffer
type FfiType = RustBuffer
source§fn lower(v: Self) -> RustBuffer
fn lower(v: Self) -> RustBuffer
source§fn try_lift(buf: RustBuffer) -> Result<Self>
fn try_lift(buf: RustBuffer) -> Result<Self>
source§impl<UT> Lift<UT> for InterestMetrics
impl<UT> Lift<UT> for InterestMetrics
source§impl<UT> LiftRef<UT> for InterestMetrics
impl<UT> LiftRef<UT> for InterestMetrics
type LiftType = InterestMetrics
source§impl<UT> LiftReturn<UT> for InterestMetrics
impl<UT> LiftReturn<UT> for InterestMetrics
source§type ReturnType = <InterestMetrics as Lift<UT>>::FfiType
type ReturnType = <InterestMetrics as Lift<UT>>::FfiType
source§fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
fn try_lift_successful_return(v: Self::ReturnType) -> Result<Self>
§fn lift_foreign_return(
ffi_return: Self::ReturnType,
call_status: RustCallStatus,
) -> Self
fn lift_foreign_return( ffi_return: Self::ReturnType, call_status: RustCallStatus, ) -> Self
§fn lift_error(_buf: RustBuffer) -> Self
fn lift_error(_buf: RustBuffer) -> Self
§fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
fn handle_callback_unexpected_error(e: UnexpectedUniFFICallbackError) -> Self
source§impl<UT> Lower<UT> for InterestMetrics
impl<UT> Lower<UT> for InterestMetrics
source§impl<UT> LowerError<UT> for InterestMetrics
impl<UT> LowerError<UT> for InterestMetrics
source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
source§impl<UT> LowerReturn<UT> for InterestMetrics
impl<UT> LowerReturn<UT> for InterestMetrics
source§type ReturnType = <InterestMetrics as Lower<UT>>::FfiType
type ReturnType = <InterestMetrics as Lower<UT>>::FfiType
source§fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(v: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
source§impl<UT> TypeId<UT> for InterestMetrics
impl<UT> TypeId<UT> for InterestMetrics
const TYPE_ID_META: MetadataBuffer = _
Auto Trait Implementations§
impl Freeze for InterestMetrics
impl RefUnwindSafe for InterestMetrics
impl Send for InterestMetrics
impl Sync for InterestMetrics
impl Unpin for InterestMetrics
impl UnwindSafe for InterestMetrics
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
Read more