Page Speed Optimization Libraries  1.9.32.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
net_instaweb::ElementSample Struct Reference

#include "mobilize_label_filter.h"

Public Member Functions

 ElementSample (int relevant_tag_depth, int tag_count, int content_bytes, int content_non_blank_bytes)
 
void ComputeProportionalFeatures (ElementSample *normalized)
 
GoogleString ToString (bool readable, HtmlParse *parser)
 

Public Attributes

HtmlElement * element
 NULL for global count.
 
ElementSampleparent
 NULL for global count.
 
MobileRole::Level role
 Mobile role (from parent where applicable)
 
std::vector< double > features
 feature vector, always of size kNumFeatures.
 

Detailed Description

Sample capturing the feature vector for a given DOM element. We compute these up the DOM tree, aggregating into the parent when each child finishes. We also keep a global root sample so we can normalize statistics, and so that every actual DOM sample has a parent.

Every feature is represented by a double entry in the feature vector f. Features ending in "Percent" have values between 0 and 100.0 and are computed at end of document by ComputeProportionalFeatures. All other features are non-negative integers in practice. We don't need the precision of doubles, but we do need the dynamic integer range or counters will peg.

Member Function Documentation

void net_instaweb::ElementSample::ComputeProportionalFeatures ( ElementSample normalized)

Here normalized represents 100 / global measurement, used as a multiplier to compute percent features.


The documentation for this struct was generated from the following file: