Documentation ¶
Index ¶
- Constants
- Variables
- type Category
- type Finder
- func (f *Finder) Find() []*Metric
- func (f *Finder) FindOne() *Metric
- func (f *Finder) WithCategory(cat Category) *Finder
- func (f *Finder) WithCondition(condition string) *Finder
- func (f *Finder) WithFieldID(fieldID string) *Finder
- func (f *Finder) WithID(ID string) *Finder
- func (f *Finder) WithOwner(owner Owner) *Finder
- func (f *Finder) WithPartition(partition string) *Finder
- func (f *Finder) WithType(Type Type) *Finder
- type Group
- type Metric
- type Owner
- type Spec
- type SpecFinder
- type Type
Constants ¶
View Source
const (
//UniqueFields is metadata needed to form unique count metric
UniqueFields = "uniquefields"
)
Variables ¶
View Source
var ( //TypesBasicMetric metric in basic metric category TypesBasicMetric = []Type{NullCount, Count, UniqueCount, Sum, InvalidCount} //TypesDataQuality is metric types in data quality category TypesDataQuality = []Type{NullnessPct, DuplicationPct, TrendInconsistencyPct, RowCount, InvalidPct} //TypeAll is all of metric types TypeAll = append(TypesDataQuality, TypesBasicMetric...) )
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category string
Category is business perspective of metric
const ( //Basic is category for metric belong to basic metric Basic Category = "basic" //Quality is category for metric belong to data quality metric Quality = "quality" )
func GetCategory ¶
GetCategory to get Category of a metric Type
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder to find metric with specific criteria
func (*Finder) Find ¶
Find find all metrics matches criteria return empty slices when no metric found
func (*Finder) FindOne ¶
FindOne find one metric matches criteria Return first found metric Might return nil when not found
func (*Finder) WithCategory ¶
func (*Finder) WithCondition ¶
func (*Finder) WithFieldID ¶
func (*Finder) WithPartition ¶
type Group ¶
type Group []*Metric
func (Group) ByGroupValue ¶
func (Group) ByPartition ¶
func (Group) ByPartitionAsMap ¶
type Metric ¶
type Metric struct { ID string FieldID string Type Type Category Category Owner Owner //Partition will be deprecated, please do not use this Partition string Metadata map[string]interface{} GroupValue string Value float64 Condition string Timestamp time.Time }
Metric information about statistical measurement of a table resource
type Spec ¶
type Spec struct { Name Type FieldID string TableID string //Condition is rule of invalidity, contains sql query and also an unique ID Condition string Owner Owner Metadata map[string]interface{} //Optional is the metric optional Optional bool }
Spec is specification of metric that generated by profiler or auditor
type SpecFinder ¶
type SpecFinder []*Spec
SpecFinder for search specific metric specs from list of metric spec
func (SpecFinder) GetMetricSpecsByFieldID ¶
func (msf SpecFinder) GetMetricSpecsByFieldID(fieldID string) ([]*Spec, error)
GetMetricSpecsByFieldID to get metrics based on field Partition
type Type ¶
type Type string
Type is type of metric
const ( //NullnessPct is nullnes percentage NullnessPct Type = "nullness_pct" //DuplicationPct is duplication percentage DuplicationPct Type = "duplication_pct" //TrendInconsistencyPct is trend inconsistency percentage TrendInconsistencyPct Type = "trend_inconsistency_pct" //RowCount is row count and is not a percentage RowCount Type = "row_count" //InvalidPct is invalid percentage InvalidPct Type = "invalid_pct" )
Click to show internal directories.
Click to hide internal directories.